{"items":[{"type":"link","label":"Aiwyn API","link":"/bundle","routeSlug":"/bundle","content":{"contentType":"overview","meta":{"name":"Aiwyn API"},"children":[{"nodeType":"container","panels":[{"title":"Download OpenAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"bundle.json","url":"/_bundle/@v1/bundle.json?download"},{"kind":"download","label":"bundle.yaml","url":"/_bundle/@v1/bundle.yaml?download"}]},{"title":"Overview","titleTranslationKey":"info.title","children":[{"kind":"externallink","title":"URL","titleTranslationKey":"info.contact.url","label":"https://www.aiwyn.ai/","url":"https://www.aiwyn.ai/"},{"kind":"email","title":"Aiwyn API support","email":"api-support@aiwyn.ai","label":"api-support@aiwyn.ai","withCopyButton":true,"copyContent":"api-support@aiwyn.ai"},{"kind":"externallink","title":"License","titleTranslationKey":"info.license","label":"Proprietary. Use is governed by your Aiwyn customer agreement.","url":"https://www.aiwyn.ai/terms-of-service"},{"kind":"externallink","label":"Terms of Service","labelTranslationKey":"info.termsOfService","url":"https://www.aiwyn.ai/terms-of-service"}]},{"title":"Languages","titleTranslationKey":"languages.title","children":[{"kind":"languages","options":[{"key":"curl","title":"curl","lang":"curl"},{"key":"javascript","title":"JavaScript","lang":"JavaScript"},{"key":"node","title":"Node.js","lang":"Node.js"},{"key":"python","title":"Python","lang":"Python"},{"key":"java","title":"Java","lang":"Java"},{"key":"csharp","title":"C#","lang":"C#"},{"key":"php","title":"PHP","lang":"PHP"},{"key":"go","title":"Go","lang":"Go"},{"key":"ruby","title":"Ruby","lang":"Ruby"},{"key":"r","title":"R","lang":"R"},{"key":"payload","title":"Payload","lang":"Payload"}]}]},{"title":"Servers","titleTranslationKey":"servers.title","children":[{"kind":"servers","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"mode":"default"}]}],"children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"header","level":1,"label":"Aiwyn API (1.0.0)","showPageActions":true},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The Aiwyn API gives your integration programmatic access to the clients, contacts, engagements,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projects, billing, payments, time, and files in your Aiwyn firm, and pushes changes to you as signed"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"webhooks."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"New here?"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" The "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/quickstart"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Quickstart"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" takes you from credentials to your first"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"request in a few minutes."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Topic"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Where"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Environments, base URLs, path prefixes, and Cloudflare Access"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/base-urls"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Base URLs & environments"},"children":[],"type":"text"}],"type":"link"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API keys and bearer tokens"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/authentication"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authentication"},"children":[],"type":"text"}],"type":"link"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Roles each endpoint requires"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/authorization"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"text"}],"type":"link"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Paging, errors, rate limits, and versions"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Errors"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/rate-limits"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Rate limits"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/versioning"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Versioning"},"children":[],"type":"text"}],"type":"link"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event payloads delivered to your endpoint"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Webhooks"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in this reference"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Questions or credentials: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"mailto:api-support@aiwyn.ai"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"api-support@aiwyn.ai"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]}],"sectionId":"/"}],"sectionId":"/"}]}]}},{"type":"separator","label":"Getting started","content":null},{"type":"group","label":"Authentication","link":"/bundle/authentication","routeSlug":"/bundle/authentication","items":[{"label":"Generate an API token","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/authentication/generateapitoken","routeSlug":"/bundle/authentication/generateapitoken","metadata":{"seo":{"title":"Generate an API token","description":"🔐 Required role: API_ADMIN, which every API key holds"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"generateApiToken","name":"Generate an API token","isWebhook":false,"pointer":"/paths/~1v1~1auth~1token/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Generate an API token","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", which every API key holds"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Exchange a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"JWT API key"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"short-lived bearer JWT"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" used to access Product APIs."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is the token-exchange endpoint itself, so no bearer token is required to call it —"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"you authenticate with your "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jwtApiKey"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in the request body."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"On Sandbox and Staging this request must also send the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" headers, or Cloudflare rejects it before it reaches the API."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"See "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/base-urls#cloudflare-access-sandbox-and-staging"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header is needed: the tenant is read from the key, and the token carries it. The token"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"lasts up to an hour: the exchange can return a token issued earlier, with less time left, so request a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"new one whenever a call answers "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". See the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/quickstart"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Quickstart"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for the full flow."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_0"}},"schemaId":"schema_0","pointer":"/paths/~1v1~1auth~1token/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/v1/auth/token","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_0"}},"responseCodes":["200","400","401","403","429"],"pointer":"/v1/auth/token","href":"authentication/generateapitoken","openApiOperationId":"generateApiToken","summary":"Generate an API token","securityGroups":[{"CfAccessClientId":[],"CfAccessClientSecret":[]},{}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_0","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_0"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"API Token generated successfully.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}},"schemaId":"schema_1"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The request body is not valid JSON or does not match the request schema (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" without"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jwtApiKey"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). The body is the standard ART error: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is human-readable and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is machine-readable ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INVALID_REQUEST_BODY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"MALFORMED_JSON"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"JSON_MAPPING_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INVALID_FORMAT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}},"schemaId":"schema_2"},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The JWT API key is not valid: it is unknown, malformed, deactivated, or belongs to a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"deactivated tenant. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is always "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UnauthorizedException"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNAUTHORIZED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a generic sentence that does not say which check failed."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/401/content/application~1json/example"]}},"schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/401/content/application~1json/example"]},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The key is valid but no token is issued: the Product API is not enabled for the firm, or the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"principal the key belongs to has no active "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" role. The body has the same shape as the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401 body, with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ForbiddenException"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" \"Access denied\" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"FORBIDDEN"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}},"schemaId":"schema_3"},{"code":"429","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Too many new tokens were issued for the API user this key belongs to in the last 10 minutes"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(all of its keys, and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/refresh-token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", share one budget). An exchange answered with the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"token already cached for this key does not count. Every new token does: the first exchange with each"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"key, one each time the cached token expires, and every refresh. Requesting a token before each call"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"with one key therefore stays within the budget; issuing new tokens in a loop, or cycling through many"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"keys of one API user, does not. Wait the number of seconds in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retry-After"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", then retry, and reuse the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"token until a call answers "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". The body has the same shape as the 401 body, with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RateLimitExceeded"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TOO_MANY_REQUESTS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". A "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"429"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" without this body and without"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retry-After"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" comes from the per-address limit at the network edge: back off and retry later."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/429/content/application~1json/example"]}},"schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/429/content/application~1json/example"],"headers":{"Retry-After":{"description":"Seconds to wait before requesting a new token.","schema":{"type":"integer","example":120}}},"headerSchemaId":"schema_4"}],"pointer":"/paths/~1v1~1auth~1token/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_1","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}}},{"code":"400","schemaId":"schema_2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}}},{"code":"401","schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/401/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/401/content/application~1json/example"]}}},{"code":"403","schemaId":"schema_3","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}}},{"code":"429","schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/429/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3","exampleIds":["paths/~1v1~1auth~1token/post/responses/429/content/application~1json/example"]}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/authentication/generateapitoken"}],"panels":[]}]},"httpPath":"/v1/auth/token"}],"content":{"contentType":"group","meta":{"name":"Authentication"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Authentication","showPageActions":true},{"nodeType":"markdoc","content":"Authentication endpoints for obtaining access tokens and managing API keys."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/v1/auth/token","summary":"Generate an API token","prefix":{"name":"post","color":"post"},"badges":[],"link":"/authentication/generateapitoken","deprecated":false}]}]}]}]}},{"type":"separator","label":"Clients & contacts","content":null},{"type":"group","label":"Client","link":"/bundle/client","routeSlug":"/bundle/client","items":[{"label":"List clients","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client/getclients","routeSlug":"/bundle/client/getclients","metadata":{"seo":{"title":"List clients","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Client"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getClients","name":"List clients","isWebhook":false,"pointer":"/paths/~1gql~1v1~1clients/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List clients","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/client"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all clients with limit/offset pagination"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint lists all clients. It does not apply filters. Use"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/clients/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when you need a where clause."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"from the response to know when you have reached the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Other behavior:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default sort is client name ascending, then "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" descending"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each client carries its department, office, industry, client type, business entity and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff assignments; relationships and optional foreign keys are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when unset"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The response includes the total count"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 50; maximum is 1000"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_5","exampleIds":["paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/first_page","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/next_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/last_partial_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/beyond_last_record"]}},"schemaId":"schema_5","exampleIds":["paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/first_page","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/next_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/last_partial_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/beyond_last_record"],"pointer":"/paths/~1gql~1v1~1clients/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/clients","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_5","exampleIds":["paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/first_page","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/next_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/last_partial_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/beyond_last_record"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/clients","href":"client/getclients","openApiOperationId":"getClients","summary":"List clients","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_5","exampleIds":["paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/first_page","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/next_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/last_partial_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/beyond_last_record"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_5","exampleIds":["paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/first_page","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/next_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/last_partial_chunk","paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/beyond_last_record"]}},"examples":[{},{},{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved client list","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6","exampleIds":["paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/empty_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/no_clients"]}},"schemaId":"schema_6","exampleIds":["paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/empty_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/no_clients"]},{"code":"400","description":"Bad request - invalid parameters","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error","exampleIds":["paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/negative_page"]}},"schemaId":"components/schemas/Error","exampleIds":["paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/negative_page"]},{"code":"401","description":"Unauthorized - missing or invalid bearer token","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7","exampleIds":["paths/~1gql~1v1~1clients/post/responses/401/content/application~1json/examples/missing_token"]}},"schemaId":"schema_7","exampleIds":["paths/~1gql~1v1~1clients/post/responses/401/content/application~1json/examples/missing_token"]},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}},"schemaId":"components/schemas/Error"}],"pointer":"/paths/~1gql~1v1~1clients/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_6","exampleIds":["paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/empty_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/no_clients"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6","exampleIds":["paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/empty_response","paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/no_clients"]}}},{"code":"400","schemaId":"components/schemas/Error","exampleIds":["paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/negative_page"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error","exampleIds":["paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/negative_page"]}}},{"code":"401","schemaId":"schema_7","exampleIds":["paths/~1gql~1v1~1clients/post/responses/401/content/application~1json/examples/missing_token"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7","exampleIds":["paths/~1gql~1v1~1clients/post/responses/401/content/application~1json/examples/missing_token"]}}},{"code":"500","schemaId":"components/schemas/Error","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client/getclients"}],"panels":[]}]},"httpPath":"/gql/v1/clients"},{"label":"Search clients","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client/filterclientsdynamic","routeSlug":"/bundle/client/filterclientsdynamic","metadata":{"seo":{"title":"Search clients","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Client"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterClientsDynamic","name":"Search clients","isWebhook":false,"pointer":"/paths/~1gql~1v1~1clients~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search clients","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/client"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced client filtering with flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clauses and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This query provides maximum flexibility for client data retrieval through"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"custom "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause construction and dynamic ordering specifications."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"It's designed for complex business requirements that need sophisticated filtering logic."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Key Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause construction for unlimited filtering combinations"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Dynamic "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"order_by"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" specifications supporting multi-field sorting with custom directions"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced boolean logic combining multiple filter conditions with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_and"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_or"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_not"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Relationship-based filtering across connected entities (contacts, staff assignments)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Enterprise-grade filtering supporting complex business logic requirements"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Support for nested queries and conditional logic patterns"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced Filtering Capabilities:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Boolean Logic"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": _and, _or, _not operators for complex condition combinations"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Text Operations"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": _like, _ilike, _regex for pattern matching and search"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Comparison Operators"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": _gt, _gte, _lt, _lte, _eq, _neq for numerical/date comparisons"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Array Operations"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": _in, _nin for multi-value filtering and inclusion/exclusion"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Null Handling"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": _is_null for empty value detection and filtering"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Relationship Traversal"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Filter on connected entities like contacts and staff"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Date Ranges"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Precision timestamp filtering for time-based analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Case Sensitivity"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Both case-sensitive and case-insensitive text matching"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Dynamic Ordering Options:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Multi-field Sorting"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Order by multiple columns with individual sort directions"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Relationship Sorting"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Sort by connected entity fields (staff names, contact info)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom Directions"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Mix ascending and descending order across different fields"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Priority Ordering"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Define primary, secondary, tertiary sort criteria"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Date-based Sorting"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": createdAt, updatedAt for chronological ordering"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Text Sorting"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Alphabetical ordering with locale-aware collation"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_8","exampleIds":["paths/~1gql~1v1~1clients~1search/post/requestBody/content/application~1json/examples/default_search"]}},"schemaId":"schema_8","exampleIds":["paths/~1gql~1v1~1clients~1search/post/requestBody/content/application~1json/examples/default_search"],"pointer":"/paths/~1gql~1v1~1clients~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/clients/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_8","exampleIds":["paths/~1gql~1v1~1clients~1search/post/requestBody/content/application~1json/examples/default_search"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/clients/search","href":"client/filterclientsdynamic","openApiOperationId":"filterClientsDynamic","summary":"Search clients","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_8","exampleIds":["paths/~1gql~1v1~1clients~1search/post/requestBody/content/application~1json/examples/default_search"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_8","exampleIds":["paths/~1gql~1v1~1clients~1search/post/requestBody/content/application~1json/examples/default_search"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved filtered clients with dynamic ordering","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_9","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"schema_9","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request - invalid filter parameters or malformed where clause","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_where_clause","paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_order_by"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_where_clause","paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_order_by"]},{"code":"401","description":"Unauthorized - missing or invalid admin secret","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/401/content/application~1json/examples/missing_auth"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/401/content/application~1json/examples/missing_auth"]},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}},"schemaId":"schema_10"}],"pointer":"/paths/~1gql~1v1~1clients~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_9","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_9","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_where_clause","paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_order_by"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_where_clause","paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_order_by"]}}},{"code":"401","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/401/content/application~1json/examples/missing_auth"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1clients~1search/post/responses/401/content/application~1json/examples/missing_auth"]}}},{"code":"500","schemaId":"schema_10","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client/filterclientsdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/clients/search"},{"label":"Get client by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client/getclientbyid","routeSlug":"/bundle/client/getclientbyid","metadata":{"seo":{"title":"Get client by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Client"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getClientById","name":"Get client by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1client~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get client by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/client"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific client by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the client wrapped in a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" key, with its department, office, industry,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client type, business entity, contact info and staff assignments. Relationships and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"optional foreign keys are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when unset."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Not found:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that matches no client returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"client\": null}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(not 404). A non-numeric "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the client","required":true,"example":122}],"pointer":"/paths/~1gql~1v1~1client~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/client/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":122,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/client/{id}","href":"client/getclientbyid","openApiOperationId":"getClientById","summary":"Get client by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client found ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the record) or not found ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_12","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_12","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}},"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this client"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1client~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_12","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_12","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1client~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client/getclientbyid"}],"panels":[]}]},"httpPath":"/gql/v1/client/{id}"},{"label":"Onboard a client","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client/onboardnewclient","routeSlug":"/bundle/client/onboardnewclient","metadata":{"seo":{"title":"Onboard a client","description":"🔐 Required role: CLIENT_C📖 Data dictionary: Client"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"onboardNewClient","name":"Onboard a client","isWebhook":false,"pointer":"/paths/~1api~1v1~1clients~1v1~1onboard/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Onboard a client","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CLIENT_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/client"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Onboard a new client with inline contact creation"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates a new client record and simultaneously resolves or creates up to three"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"associated contacts (preferred, billing, and secondary). Each contact field accepts"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"either an existing contact ID or a full inline payload to create a brand-new contact."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required fields:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"name"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — client display name"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — practice management system reference"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — unique client reference identifier"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"officeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — ID of the office this client belongs to"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A client "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that already exists is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and nothing is created;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"onboarding never updates an existing client."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact fields"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"prefContact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingContact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"secondaryContact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"):"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each contact field is optional but, when provided, must include "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"either"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" an existing"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"or"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contactInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" object — not both."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When supplying "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contactInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on the contact payload is required."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"At least one of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"prefix"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"firstName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"lastName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" must be provided inside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contactInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to form a valid full name."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Classification & billing fields"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (all optional):"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientBusinessEntityId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (entity type), and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffBillingManagerId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"each reference an existing record; an unknown ID is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"fiscalYearEndMonth"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (1–12) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fiscalYearEndDay"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (1–31) capture the client's fiscal"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"year end."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom fields"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"customFieldValuesJson"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"): a JSON object, encoded as a string, mapping"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"custom field keys to values. Keys not defined in the tenant's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CLIENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" custom-field schema,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and keys of read-only or hidden fields, are dropped rather than failing the request, and are"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"echoed back in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.ignoredCustomFields"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (and appended to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"meta.message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). The onboard"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"still returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"201"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax regions"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taxRegionIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"): a list of existing tax region IDs to link to the new"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client. Duplicate IDs are de-duplicated; an unknown ID is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". The"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"assigned IDs are returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.taxRegionIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Addresses"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"address"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingAddress"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), both optional and stored the same way the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Firm Portal \"Create New Client\" dialog stores them:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"address"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the client's own address. It is saved as the client's contact info record"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and shows in the portal's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"*"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Address"},"children":[],"type":"text"}],"type":"em"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" section; its ID is returned in"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.clientContactInfoId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingAddress"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is saved as a client address of type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"*"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billing"},"children":[],"type":"text"}],"type":"em"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and shows in the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"portal's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"*"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billing Address"},"children":[],"type":"text"}],"type":"em"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" section; its ID is returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.billingAddressId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"country"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" must be an ISO 3166-1 alpha-2 code (e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"US"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CA"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GB"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"); it is accepted"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"case-insensitively and stored upper-case."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"country"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"US"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"state"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" must be a US state name or abbreviation and is stored"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"as the abbreviation (e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"North Carolina"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" → "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"NC"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). For other countries "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"state"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"stored as given."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is optional on both; when omitted an Aiwyn reference ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"AIWYN_<uuid>"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"generated. A "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that already exists is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"An address object must carry at least one address field; an invalid country, state or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"duplicate "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" rejects the whole request with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and no client is created."},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_14","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/new_contact_inline","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/existing_contact","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/crm_integration_fields","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/with_addresses"]}},"schemaId":"schema_14","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/new_contact_inline","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/existing_contact","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/crm_integration_fields","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/with_addresses"],"pointer":"/paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/clients/v1/onboard","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_14","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/new_contact_inline","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/existing_contact","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/crm_integration_fields","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/with_addresses"]}},"responseCodes":["201","400","401","403","500"],"pointer":"/api/v1/clients/v1/onboard","href":"client/onboardnewclient","openApiOperationId":"onboardNewClient","summary":"Onboard a client","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_14","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/new_contact_inline","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/existing_contact","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/crm_integration_fields","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/with_addresses"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_14","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/new_contact_inline","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/existing_contact","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/crm_integration_fields","paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/with_addresses"]}},"examples":[{},{},{},{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"201","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client onboarded successfully. The body is the standard ART envelope: the result is in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the success flag and message are in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"meta"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (there is no top-level "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"success"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). Unknown custom field keys are dropped and reported in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.ignoredCustomFields"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the write still succeeds."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_15","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_addresses","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_ignored_custom_fields"]}},"schemaId":"schema_15","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_addresses","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_ignored_custom_fields"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invalid input data — for example, a client with the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" already exists, both "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contactInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" were supplied on a contact field, a required field is missing, or an address has an unknown country/US state or a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that already exists. A body that fails request validation (missing or malformed fields) returns the global ART error shape "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ message, extensions: { code, details } }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; a request rejected by the onboarding rules (duplicate client "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", unknown reference IDs, invalid address) returns the envelope "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ error: { code, message }, meta: { success: false } }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_16","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/400/content/application~1json/examples/duplicate_client_pms_ref"]}},"schemaId":"schema_16","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/400/content/application~1json/examples/duplicate_client_pms_ref"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires ROLE_CLIENT_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1clients~1v1~1onboard/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"201","schemaId":"schema_15","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_addresses","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_ignored_custom_fields"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_15","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_addresses","paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_ignored_custom_fields"]}}},{"code":"400","schemaId":"schema_16","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/400/content/application~1json/examples/duplicate_client_pms_ref"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_16","exampleIds":["paths/~1api~1v1~1clients~1v1~1onboard/post/responses/400/content/application~1json/examples/duplicate_client_pms_ref"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client/onboardnewclient"}],"panels":[]}]},"httpPath":"/api/v1/clients/v1/onboard"},{"label":"List client types","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client/getclienttypespaginated","routeSlug":"/bundle/client/getclienttypespaginated","metadata":{"seo":{"title":"List client types","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Client type"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getClientTypesPaginated","name":"List client types","isWebhook":false,"pointer":"/paths/~1gql~1v1~1client_types/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List client types","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/client-type"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client type"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all client types with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint. Use it to resolve the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values accepted by the Client Onboarding endpoint"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/clients/v1/onboard"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_types/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_types/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1client_types/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/client_types","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_types/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/client_types","href":"client/getclienttypespaginated","openApiOperationId":"getClientTypesPaginated","summary":"List client types","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_types/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_types/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved client types","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_18","exampleIds":["paths/~1gql~1v1~1client_types/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_18","exampleIds":["paths/~1gql~1v1~1client_types/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1client_types/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_18","exampleIds":["paths/~1gql~1v1~1client_types/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_18","exampleIds":["paths/~1gql~1v1~1client_types/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client/getclienttypespaginated"}],"panels":[]}]},"httpPath":"/gql/v1/client_types"},{"label":"List tax regions","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client/gettaxregionspaginated","routeSlug":"/bundle/client/gettaxregionspaginated","metadata":{"seo":{"title":"List tax regions","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Tax region"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getTaxRegionsPaginated","name":"List tax regions","isWebhook":false,"pointer":"/paths/~1gql~1v1~1tax_regions/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List tax regions","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/tax-region"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax region"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all tax regions with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint. Use it to resolve the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taxRegionIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values accepted by the Client Onboarding endpoint"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/clients/v1/onboard"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unlike the other lookups, item keys are snake_case ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tax_percentage"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"created_at"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", …)."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1tax_regions/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1tax_regions/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1tax_regions/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/tax_regions","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1tax_regions/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/tax_regions","href":"client/gettaxregionspaginated","openApiOperationId":"getTaxRegionsPaginated","summary":"List tax regions","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1tax_regions/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1tax_regions/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved tax regions","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_19","exampleIds":["paths/~1gql~1v1~1tax_regions/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_19","exampleIds":["paths/~1gql~1v1~1tax_regions/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1tax_regions/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_19","exampleIds":["paths/~1gql~1v1~1tax_regions/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_19","exampleIds":["paths/~1gql~1v1~1tax_regions/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client/gettaxregionspaginated"}],"panels":[]}]},"httpPath":"/gql/v1/tax_regions"}],"content":{"contentType":"group","meta":{"name":"Client"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Client","showPageActions":true},{"nodeType":"markdoc","content":"Manage client records, profiles, and related operations."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/clients","summary":"List clients","prefix":{"name":"post","color":"post"},"badges":[],"link":"/client/getclients","deprecated":false},{"title":"/gql/v1/clients/search","summary":"Search clients","prefix":{"name":"post","color":"post"},"badges":[],"link":"/client/filterclientsdynamic","deprecated":false},{"title":"/gql/v1/client/{id}","summary":"Get client by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/client/getclientbyid","deprecated":false},{"title":"/api/v1/clients/v1/onboard","summary":"Onboard a client","prefix":{"name":"post","color":"post"},"badges":[],"link":"/client/onboardnewclient","deprecated":false},{"title":"/gql/v1/client_types","summary":"List client types","prefix":{"name":"post","color":"post"},"badges":[],"link":"/client/getclienttypespaginated","deprecated":false},{"title":"/gql/v1/tax_regions","summary":"List tax regions","prefix":{"name":"post","color":"post"},"badges":[],"link":"/client/gettaxregionspaginated","deprecated":false}]}]}]}]}},{"type":"group","label":"Client group","link":"/bundle/client-group","routeSlug":"/bundle/client-group","items":[{"label":"List client groups","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client-group/getclientgroups","routeSlug":"/bundle/client-group/getclientgroups","metadata":{"seo":{"title":"List client groups","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Client group"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getClientGroups","name":"List client groups","isWebhook":false,"pointer":"/paths/~1gql~1v1~1client_groups/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List client groups","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/client-group"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client group"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all client groups with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint returns a paginated list of all client groups in the tenant,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"including assigned partner/manager staff and office information. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"partnerStaff"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"managerStaff"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"office"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the group has no such assignment."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Key Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Basic pagination with configurable page sizes (default: 50 records)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default sorting by client group name (ascending) then creation date (descending)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Total count aggregation for pagination metadata"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_20","exampleIds":["paths/~1gql~1v1~1client_groups/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_20","exampleIds":["paths/~1gql~1v1~1client_groups/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1client_groups/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/client_groups","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_20","exampleIds":["paths/~1gql~1v1~1client_groups/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/client_groups","href":"client-group/getclientgroups","openApiOperationId":"getClientGroups","summary":"List client groups","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_20","exampleIds":["paths/~1gql~1v1~1client_groups/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_20","exampleIds":["paths/~1gql~1v1~1client_groups/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved client group list","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_21","exampleIds":["paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"schema_21","exampleIds":["paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request - invalid parameters","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}},"schemaId":"components/schemas/Error"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}},"schemaId":"components/schemas/Error"}],"pointer":"/paths/~1gql~1v1~1client_groups/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_21","exampleIds":["paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_21","exampleIds":["paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400","schemaId":"components/schemas/Error","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}}},{"code":"401"},{"code":"500","schemaId":"components/schemas/Error","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client-group/getclientgroups"}],"panels":[]}]},"httpPath":"/gql/v1/client_groups"}],"content":{"contentType":"group","meta":{"name":"Client Group"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Client group","showPageActions":true},{"nodeType":"markdoc","content":"Manage client group records and associated staff assignments."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/client_groups","summary":"List client groups","prefix":{"name":"post","color":"post"},"badges":[],"link":"/client-group/getclientgroups","deprecated":false}]}]}]}]}},{"type":"group","label":"Client business entity","link":"/bundle/client-business-entity","routeSlug":"/bundle/client-business-entity","items":[{"label":"List client business entities","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/client-business-entity/getclientbusinessentitiespaginated","routeSlug":"/bundle/client-business-entity/getclientbusinessentitiespaginated","metadata":{"seo":{"title":"List client business entities","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Client business entity"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getClientBusinessEntitiesPaginated","name":"List client business entities","isWebhook":false,"pointer":"/paths/~1gql~1v1~1client_business_entities/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List client business entities","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/client-business-entity"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client business entity"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all client business entities with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint. It is useful after creating records via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/api/v1/records"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1client_business_entities/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/client_business_entities","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/client_business_entities","href":"client-business-entity/getclientbusinessentitiespaginated","openApiOperationId":"getClientBusinessEntitiesPaginated","summary":"List client business entities","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved client business entities","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_22","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_22","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1client_business_entities/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_22","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_22","exampleIds":["paths/~1gql~1v1~1client_business_entities/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/client-business-entity/getclientbusinessentitiespaginated"}],"panels":[]}]},"httpPath":"/gql/v1/client_business_entities"}],"content":{"contentType":"group","meta":{"name":"Client Business Entity"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Client business entity","showPageActions":true},{"nodeType":"markdoc","content":"Manage client business entities used for client categorization and structure."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/client_business_entities","summary":"List client business entities","prefix":{"name":"post","color":"post"},"badges":[],"link":"/client-business-entity/getclientbusinessentitiespaginated","deprecated":false}]}]}]}]}},{"type":"group","label":"Contact","link":"/bundle/contact","routeSlug":"/bundle/contact","items":[{"label":"List contacts","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/contact/getcontactspaginated","routeSlug":"/bundle/contact/getcontactspaginated","metadata":{"seo":{"title":"List contacts","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Contact"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getContactsPaginated","name":"List contacts","isWebhook":false,"pointer":"/paths/~1gql~1v1~1contacts/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List contacts","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/contact"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all contacts with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns a paginated list of contacts. Default sort prioritizes last/first name."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contacts/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contacts/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1contacts/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/contacts","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contacts/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/contacts","href":"contact/getcontactspaginated","openApiOperationId":"getContactsPaginated","summary":"List contacts","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contacts/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contacts/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved contacts","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1contacts/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/contact/getcontactspaginated"}],"panels":[]}]},"httpPath":"/gql/v1/contacts"},{"label":"Search contacts","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/contact/filtercontactsdynamic","routeSlug":"/bundle/contact/filtercontactsdynamic","metadata":{"seo":{"title":"Search contacts","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Contact"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterContactsDynamic","name":"Search contacts","isWebhook":false,"pointer":"/paths/~1gql~1v1~1contacts~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search contacts","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/contact"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced contact filtering with flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clauses and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Filter contacts using boolean logic and relationship-aware fields from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contact_info"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_23","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_23","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1gql~1v1~1contacts~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/contacts/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_23","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/contacts/search","href":"contact/filtercontactsdynamic","openApiOperationId":"filterContactsDynamic","summary":"Search contacts","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_23","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_23","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Successfully retrieved filtered contacts; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" counts the contacts matching "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request - invalid where/orderBy"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1contacts~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ContactListResponse","exampleIds":["paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/contact/filtercontactsdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/contacts/search"},{"label":"Get contact by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/contact/getcontactbyid","routeSlug":"/bundle/contact/getcontactbyid","metadata":{"seo":{"title":"Get contact by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Contact"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getContactById","name":"Get contact by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1contact~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get contact by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/contact"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific contact by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the contact wrapped in a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" key, with its contact info (name, email,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"phone, address) and its client links. Field names are snake_case except"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contact_info.firstName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contact_info.lastName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Optional columns are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when unset."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Not found:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that matches no contact returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"contact\": null}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(not 404). A non-numeric "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the contact","required":true,"example":1001}],"pointer":"/paths/~1gql~1v1~1contact~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/contact/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":1001,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/contact/{id}","href":"contact/getcontactbyid","openApiOperationId":"getContactById","summary":"Get contact by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact found ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the record) or not found ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_24","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_24","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}},"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this contact"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1contact~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_24","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_24","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contact~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/contact/getcontactbyid"}],"panels":[]}]},"httpPath":"/gql/v1/contact/{id}"},{"label":"Get contacts by client ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/contact/getcontactsbyclientid","routeSlug":"/bundle/contact/getcontactsbyclientid","metadata":{"seo":{"title":"Get contacts by client ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Contact"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getContactsByClientId","name":"Get contacts by client ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get contacts by client ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/contact"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve active contacts associated with a specific client"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns all contacts linked to the given client via the contact-client relationship,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where the contact, contact-client link, and contact info are all active."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Results are ordered by last name then first name."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"clientId","in":"path","schemaId":"schema_11","description":"Unique identifier of the client","required":true,"example":789}],"pointer":"/paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/contacts/by_client/{clientId}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"clientId","in":"path","required":true,"example":789,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/contacts/by_client/{clientId}","href":"contact/getcontactsbyclientid","openApiOperationId":"getContactsByClientId","summary":"Get contacts by client ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Active contacts for the client retrieved successfully. Only active links whose contact"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and contact info are active are returned, ordered by last name then first name. A"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that matches no client returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"contacts\": []}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_25","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/200/content/application~1json/examples/success"]}},"schemaId":"schema_25","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/200/content/application~1json/examples/success"]},{"code":"400","description":"Bad request - the clientId is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/400/content/application~1json/examples/non_numeric_id"]}},"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/400/content/application~1json/examples/non_numeric_id"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_25","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/200/content/application~1json/examples/success"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_25","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/200/content/application~1json/examples/success"]}}},{"code":"400","schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/400/content/application~1json/examples/non_numeric_id"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/400/content/application~1json/examples/non_numeric_id"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/contact/getcontactsbyclientid"}],"panels":[]}]},"httpPath":"/gql/v1/contacts/by_client/{clientId}"},{"label":"Upsert contacts","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/contact/upsertcontact","routeSlug":"/bundle/contact/upsertcontact","metadata":{"seo":{"title":"Upsert contacts","description":"🔐 Required role: RECD_C📖 Data dictionary: Contact"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertContact","name":"Upsert contacts","isWebhook":false,"pointer":"/paths/~1api~1v1~1contacts~1upsert/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Upsert contacts","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/contact"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Upsert up to 100 contacts, each linked to one or more existing clients, in one request"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contacts"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" array (1–100). Each entry upserts a contact (contact_info + contact) and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"its links to existing clients, all by external reference — no Aiwyn internal ids required."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Partial success."},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Each contact is processed independently in its own transaction, so one"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"failing contact does not roll back the others. The response splits contacts into "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"failed"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (each keyed by request-order "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"); the HTTP status is 200 whenever the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"request itself is valid — inspect the lists for individual outcomes."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Per contact:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Matched by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (contact) and the (contact, client) pair (links); re-sending updates, never duplicates."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" optional: omit to create a native contact (mints "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"AIWYN_<uuid>"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", not idempotent)."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" optional: omit or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"[]"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" upserts only the contact; unlink via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active: false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (never by absence)."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" resolves by the client's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"sysRefs"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; refs must not contain "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":":"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"All-or-nothing for that one contact: any unresolved client or stage failure persists nothing for it."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Facade over "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/records"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Bulk contact synchronization"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Link contacts to existing clients"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Partial success — one contact's client cannot be resolved:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"contacts\": [\n    { \"pmsRef\": \"CONTACT-001\", \"contactInfo\": { \"firstName\": \"Jane\", \"lastName\": \"Smith\" }, \"clients\": [ { \"clientRef\": \"CLIENT-12345\" } ] },\n    { \"pmsRef\": \"CONTACT-BAD\", \"contactInfo\": { \"firstName\": \"Ghost\", \"lastName\": \"User\" }, \"clients\": [ { \"clientRef\": \"DOES-NOT-EXIST\" } ] }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"contacts\": [\n    { \"pmsRef\": \"CONTACT-001\", \"contactInfo\": { \"firstName\": \"Jane\", \"lastName\": \"Smith\" }, \"clients\": [ { \"clientRef\": \"CLIENT-12345\" } ] },\n    { \"pmsRef\": \"CONTACT-BAD\", \"contactInfo\": { \"firstName\": \"Ghost\", \"lastName\": \"User\" }, \"clients\": [ { \"clientRef\": \"DOES-NOT-EXIST\" } ] }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create native — omit pmsRef to create a new Aiwyn contact (server mints AIWYN_<uuid>):"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"contacts\": [\n    { \"contactInfo\": { \"firstName\": \"Jane\", \"lastName\": \"Smith\", \"email\": \"jane.smith@example.com\" } }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"contacts\": [\n    { \"contactInfo\": { \"firstName\": \"Jane\", \"lastName\": \"Smith\", \"email\": \"jane.smith@example.com\" } }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_26","exampleIds":["paths/~1api~1v1~1contacts~1upsert/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_26","exampleIds":["paths/~1api~1v1~1contacts~1upsert/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1contacts~1upsert/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/contacts/upsert","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_26","exampleIds":["paths/~1api~1v1~1contacts~1upsert/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/contacts/upsert","href":"contact/upsertcontact","openApiOperationId":"upsertContact","summary":"Upsert contacts","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_26","exampleIds":["paths/~1api~1v1~1contacts~1upsert/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_26","exampleIds":["paths/~1api~1v1~1contacts~1upsert/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Batch processed; see the succeeded / failed lists","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_27"}},"schemaId":"schema_27"},{"code":"400","description":"Invalid request (empty or more than 100 contacts, or malformed body)"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires RECD_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1contacts~1upsert/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_27","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_27"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/contact/upsertcontact"}],"panels":[]}]},"httpPath":"/api/v1/contacts/upsert"}],"content":{"contentType":"group","meta":{"name":"Contact"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Contact","showPageActions":true},{"nodeType":"markdoc","content":"Manage contact information and relationships for clients."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/contacts","summary":"List contacts","prefix":{"name":"post","color":"post"},"badges":[],"link":"/contact/getcontactspaginated","deprecated":false},{"title":"/gql/v1/contacts/search","summary":"Search contacts","prefix":{"name":"post","color":"post"},"badges":[],"link":"/contact/filtercontactsdynamic","deprecated":false},{"title":"/gql/v1/contact/{id}","summary":"Get contact by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/contact/getcontactbyid","deprecated":false},{"title":"/gql/v1/contacts/by_client/{clientId}","summary":"Get contacts by client ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/contact/getcontactsbyclientid","deprecated":false},{"title":"/api/v1/contacts/upsert","summary":"Upsert contacts","prefix":{"name":"post","color":"post"},"badges":[],"link":"/contact/upsertcontact","deprecated":false}]}]}]}]}},{"type":"group","label":"Contact client","link":"/bundle/contact-client","routeSlug":"/bundle/contact-client","items":[{"label":"List contact-client relationships","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/contact-client/getcontactclientspaginated","routeSlug":"/bundle/contact-client/getcontactclientspaginated","metadata":{"seo":{"title":"List contact-client relationships","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Contact-client relationship"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getContactClientsPaginated","name":"List contact-client relationships","isWebhook":false,"pointer":"/paths/~1gql~1v1~1contact_clients/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List contact-client relationships","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/contact-client"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact-client relationship"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all contact-client relationships with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_clients/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_clients/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1contact_clients/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/contact_clients","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_clients/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/contact_clients","href":"contact-client/getcontactclientspaginated","openApiOperationId":"getContactClientsPaginated","summary":"List contact-client relationships","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_clients/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_clients/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved contact-client relationships","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_28","exampleIds":["paths/~1gql~1v1~1contact_clients/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_28","exampleIds":["paths/~1gql~1v1~1contact_clients/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1contact_clients/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_28","exampleIds":["paths/~1gql~1v1~1contact_clients/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_28","exampleIds":["paths/~1gql~1v1~1contact_clients/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/contact-client/getcontactclientspaginated"}],"panels":[]}]},"httpPath":"/gql/v1/contact_clients"}],"content":{"contentType":"group","meta":{"name":"Contact Client"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Contact client","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Manage contact ↔ client relationship records."},"children":[],"type":"text"}],"type":"paragraph"}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/contact_clients","summary":"List contact-client relationships","prefix":{"name":"post","color":"post"},"badges":[],"link":"/contact-client/getcontactclientspaginated","deprecated":false}]}]}]}]}},{"type":"group","label":"Contact info","link":"/bundle/contact-info","routeSlug":"/bundle/contact-info","items":[{"label":"List contact infos","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/contact-info/getcontactinfospaginated","routeSlug":"/bundle/contact-info/getcontactinfospaginated","metadata":{"seo":{"title":"List contact infos","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Contact info"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getContactInfosPaginated","name":"List contact infos","isWebhook":false,"pointer":"/paths/~1gql~1v1~1contact_infos/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List contact infos","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/contact-info"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact info"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all contact info records with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_infos/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_infos/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1contact_infos/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/contact_infos","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_infos/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/contact_infos","href":"contact-info/getcontactinfospaginated","openApiOperationId":"getContactInfosPaginated","summary":"List contact infos","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_infos/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1contact_infos/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved contact infos","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_29","exampleIds":["paths/~1gql~1v1~1contact_infos/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_29","exampleIds":["paths/~1gql~1v1~1contact_infos/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1contact_infos/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_29","exampleIds":["paths/~1gql~1v1~1contact_infos/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_29","exampleIds":["paths/~1gql~1v1~1contact_infos/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/contact-info/getcontactinfospaginated"}],"panels":[]}]},"httpPath":"/gql/v1/contact_infos"}],"content":{"contentType":"group","meta":{"name":"Contact Info"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Contact info","showPageActions":true},{"nodeType":"markdoc","content":"Manage contact information records (address, email, phone, etc.)."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/contact_infos","summary":"List contact infos","prefix":{"name":"post","color":"post"},"badges":[],"link":"/contact-info/getcontactinfospaginated","deprecated":false}]}]}]}]}},{"type":"separator","label":"Engagements & projects","content":null},{"type":"group","label":"Engagement","link":"/bundle/engagement","routeSlug":"/bundle/engagement","items":[{"label":"List engagements","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/getengagements","routeSlug":"/bundle/engagement/getengagements","metadata":{"seo":{"title":"List engagements","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Engagement"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getEngagements","name":"List engagements","isWebhook":false,"pointer":"/paths/~1gql~1v1~1engagements/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List engagements","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project engagement tracking with comprehensive workflow management"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint delivers complete project engagement management including:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client engagement tracking with date-based filtering"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Multi-level staff assignment management (partner and manager roles)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project status workflow tracking and reporting"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Template-driven engagement naming and standardization"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Date range analysis for project timeline management"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project Management Capabilities:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Start and end date tracking for project lifecycles"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Status-based workflow management (DRAFT, SENT, EXECUTED, etc.)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff assignment tracking at partner and manager levels"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client relationship management for engagement context"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Workflow Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Template-based engagement creation for consistency"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Status progression tracking for project milestones"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff allocation and responsibility assignment"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client-specific engagement history and analysis"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Intelligence:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement duration analysis and reporting"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff utilization and assignment tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client engagement patterns and history"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project status distribution and workflow analysis"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Filtering:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" this operation accepts only "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and any other body"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"property is rejected with 400. To filter or sort, use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/engagements/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Rows are ordered by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"name"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ascending, then "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" descending. The response holds the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rows in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagements"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the total number of engagements in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1engagements/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1engagements/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1engagements/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/engagements","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1engagements/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/engagements","href":"engagement/getengagements","openApiOperationId":"getEngagements","summary":"List engagements","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1engagements/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1engagements/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved engagement records","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request. Hasura rejects a body property the operation does not declare\n(for example a filter; use the search operation instead).\n","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/400/content/application~1json/examples/unexpected_variable"]}},"schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/400/content/application~1json/examples/unexpected_variable"]},{"code":"401","description":"Unauthorized - missing or invalid authentication token","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/401/content/application~1json/examples/missing_auth"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/401/content/application~1json/examples/missing_auth"]},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}},"schemaId":"schema_10"}],"pointer":"/paths/~1gql~1v1~1engagements/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400","schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/400/content/application~1json/examples/unexpected_variable"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/400/content/application~1json/examples/unexpected_variable"]}}},{"code":"401","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/401/content/application~1json/examples/missing_auth"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1engagements/post/responses/401/content/application~1json/examples/missing_auth"]}}},{"code":"500","schemaId":"schema_10","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/getengagements"}],"panels":[]}]},"httpPath":"/gql/v1/engagements"},{"label":"Search engagements","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/searchengagementsdynamic","routeSlug":"/bundle/engagement/searchengagementsdynamic","metadata":{"seo":{"title":"Search engagements","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Engagement"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"searchEngagementsDynamic","name":"Search engagements","isWebhook":false,"pointer":"/paths/~1gql~1v1~1engagements~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search engagements","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Search Engagements with Dynamic Filters"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint allows you to search engagements using dynamic filters, enabling flexible querying based on various criteria."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The response holds the matching rows in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagements"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (the same row shape as the list"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation) and the number of engagements matching "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports multiple filter conditions"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination for large result sets"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Sorting options for results"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_32","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/requestBody/content/application~1json/examples/default_search"]}},"schemaId":"schema_32","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/requestBody/content/application~1json/examples/default_search"],"pointer":"/paths/~1gql~1v1~1engagements~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/engagements/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_32","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/requestBody/content/application~1json/examples/default_search"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/engagements/search","href":"engagement/searchengagementsdynamic","openApiOperationId":"searchEngagementsDynamic","summary":"Search engagements","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_32","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/requestBody/content/application~1json/examples/default_search"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_32","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/requestBody/content/application~1json/examples/default_search"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Engagements retrieved successfully.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/responses/200/content/application~1json/examples/matching_engagements"]}},"schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/responses/200/content/application~1json/examples/matching_engagements"]},{"code":"400","description":"Bad Request - Invalid input parameters.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}},"schemaId":"components/schemas/Error"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}},"schemaId":"components/schemas/Error"},{"code":"500","description":"Internal Server Error - An unexpected error occurred.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}},"schemaId":"components/schemas/Error"}],"pointer":"/paths/~1gql~1v1~1engagements~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/responses/200/content/application~1json/examples/matching_engagements"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/EngagementListResponse","exampleIds":["paths/~1gql~1v1~1engagements~1search/post/responses/200/content/application~1json/examples/matching_engagements"]}}},{"code":"400","schemaId":"components/schemas/Error","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}}},{"code":"401","schemaId":"components/schemas/Error","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}}},{"code":"500","schemaId":"components/schemas/Error","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/Error"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/searchengagementsdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/engagements/search"},{"label":"Get engagement by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/getengagementbyid","routeSlug":"/bundle/engagement/getengagementbyid","metadata":{"seo":{"title":"Get engagement by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Engagement"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getEngagementById","name":"Get engagement by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1engagement~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get engagement by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific engagement by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The engagement is returned in an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagement"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" array that holds at most one row, with the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"same row shape as the engagement list and search operations: engagement dates and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"statuses, the linked projects ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobs"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and the partner, manager, creator, last updater"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and executor staff."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"An id that matches no active engagement returns 200 with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"engagement\": []"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; this"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation never returns 404. A non-numeric id returns 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"engagement\": [\n    {\n      \"id\": 85,\n      \"name\": \"2026 Test 999408\",\n      \"status\": \"EXECUTED\",\n      \"isActive\": true,\n      \"endDt\": null,\n      \"startDt\": null,\n      \"fiscalYear\": 2026,\n      \"engagementNameTemplate\": \"2026 Test 999408\",\n      \"createdAt\": \"2026-06-08T16:40:09.096612+00:00\",\n      \"sentAt\": \"2026-06-08T16:45:00.414069+00:00\",\n      \"executedAt\": \"2026-06-08T16:46:48.196882+00:00\",\n      \"isStartOnAcceptance\": true,\n      \"updatedAt\": \"2026-06-08T16:46:48.199113+00:00\",\n      \"paymentInfoType\": \"OPTIONAL\",\n      \"canceledAt\": null,\n      \"mode\": \"AUTOMATIC\",\n      \"addressContactInfoId\": null,\n      \"originatingEngagementId\": null,\n      \"clientId\": 92,\n      \"jobs\": [\n        {\n          \"id\": 1,\n          \"jobId\": 829,\n          \"jobServiceTermId\": null,\n          \"engagementCustomJobServiceTermId\": null,\n          \"isActive\": true,\n          \"job\": {\n            \"id\": 829,\n            \"name\": \"Expatriate Tax Services\",\n            \"status\": \"OPEN\",\n            \"clientId\": 92,\n            \"pmsRef\": \"AIWYN_829\",\n            \"jobRef\": null,\n            \"sysRefs\": {}\n          }\n        }\n      ],\n      \"partnerStaff\": {\n        \"id\": 18,\n        \"firstName\": \"Robert\",\n        \"lastName\": \"Johnson\",\n        \"fullName\": \"Robert Johnson\",\n        \"pmsRef\": \"AIWYN_18\",\n        \"email\": \"r.johnson@company.com\",\n        \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\"\n      },\n      \"managerStaff\": { \"id\": 18, \"firstName\": \"Robert\", \"lastName\": \"Johnson\", \"fullName\": \"Robert Johnson\", \"pmsRef\": \"AIWYN_18\", \"email\": \"r.johnson@company.com\", \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\" },\n      \"createdByStaff\": { \"id\": 18, \"firstName\": \"Robert\", \"lastName\": \"Johnson\", \"fullName\": \"Robert Johnson\", \"pmsRef\": \"AIWYN_18\", \"email\": \"r.johnson@company.com\", \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\" },\n      \"lastUpdatedByStaff\": { \"id\": 18, \"firstName\": \"Robert\", \"lastName\": \"Johnson\", \"fullName\": \"Robert Johnson\", \"pmsRef\": \"AIWYN_18\", \"email\": \"r.johnson@company.com\", \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\" },\n      \"executedByStaff\": null,\n      \"renewedAt\": null\n    }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"engagement\": [\n    {\n      \"id\": 85,\n      \"name\": \"2026 Test 999408\",\n      \"status\": \"EXECUTED\",\n      \"isActive\": true,\n      \"endDt\": null,\n      \"startDt\": null,\n      \"fiscalYear\": 2026,\n      \"engagementNameTemplate\": \"2026 Test 999408\",\n      \"createdAt\": \"2026-06-08T16:40:09.096612+00:00\",\n      \"sentAt\": \"2026-06-08T16:45:00.414069+00:00\",\n      \"executedAt\": \"2026-06-08T16:46:48.196882+00:00\",\n      \"isStartOnAcceptance\": true,\n      \"updatedAt\": \"2026-06-08T16:46:48.199113+00:00\",\n      \"paymentInfoType\": \"OPTIONAL\",\n      \"canceledAt\": null,\n      \"mode\": \"AUTOMATIC\",\n      \"addressContactInfoId\": null,\n      \"originatingEngagementId\": null,\n      \"clientId\": 92,\n      \"jobs\": [\n        {\n          \"id\": 1,\n          \"jobId\": 829,\n          \"jobServiceTermId\": null,\n          \"engagementCustomJobServiceTermId\": null,\n          \"isActive\": true,\n          \"job\": {\n            \"id\": 829,\n            \"name\": \"Expatriate Tax Services\",\n            \"status\": \"OPEN\",\n            \"clientId\": 92,\n            \"pmsRef\": \"AIWYN_829\",\n            \"jobRef\": null,\n            \"sysRefs\": {}\n          }\n        }\n      ],\n      \"partnerStaff\": {\n        \"id\": 18,\n        \"firstName\": \"Robert\",\n        \"lastName\": \"Johnson\",\n        \"fullName\": \"Robert Johnson\",\n        \"pmsRef\": \"AIWYN_18\",\n        \"email\": \"r.johnson@company.com\",\n        \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\"\n      },\n      \"managerStaff\": { \"id\": 18, \"firstName\": \"Robert\", \"lastName\": \"Johnson\", \"fullName\": \"Robert Johnson\", \"pmsRef\": \"AIWYN_18\", \"email\": \"r.johnson@company.com\", \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\" },\n      \"createdByStaff\": { \"id\": 18, \"firstName\": \"Robert\", \"lastName\": \"Johnson\", \"fullName\": \"Robert Johnson\", \"pmsRef\": \"AIWYN_18\", \"email\": \"r.johnson@company.com\", \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\" },\n      \"lastUpdatedByStaff\": { \"id\": 18, \"firstName\": \"Robert\", \"lastName\": \"Johnson\", \"fullName\": \"Robert Johnson\", \"pmsRef\": \"AIWYN_18\", \"email\": \"r.johnson@company.com\", \"createdAt\": \"2026-06-08T16:26:36.875604+00:00\" },\n      \"executedByStaff\": null,\n      \"renewedAt\": null\n    }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the engagement","required":true,"example":85}],"pointer":"/paths/~1gql~1v1~1engagement~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/engagement/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":85,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/engagement/{id}","href":"engagement/getengagementbyid","openApiOperationId":"getEngagementById","summary":"Get engagement by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement lookup completed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagement"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" holds the engagement, or is empty when no"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active engagement has this id."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_33","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_33","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}},"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this engagement"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1engagement~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_33","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_33","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1engagement~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/getengagementbyid"}],"panels":[]}]},"httpPath":"/gql/v1/engagement/{id}"},{"label":"Update an existing engagement","deprecated":false,"httpVerb":"patch","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/updateengagement","routeSlug":"/bundle/engagement/updateengagement","metadata":{"seo":{"title":"Update an existing engagement","description":"🔐 Required role: ENG_C📖 Data dictionary: Engagement"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"updateEngagement","name":"Update an existing engagement","isWebhook":false,"pointer":"/paths/~1api~1v1~1engagements~1{engagementId}/patch","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Update an existing engagement","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ENG_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Update an existing engagement by ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Partially updates an engagement. Only the fields included in the request body"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"are modified — omitted fields are left unchanged. At least one field must be"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"provided."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Updatable Fields:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Core engagement data (client, fiscal year, partner/manager staff, contacts,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"start/end dates, billing contact, CC staff, name template)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement letter template and document template"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Additional clients assigned to the engagement (full replace when provided)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Linked jobs/projects (full replace when provided)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Validation:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The engagement must exist (404 if not found)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The engagement must be in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DRAFT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNDER_REVISION"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" status (400 otherwise)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"All provided IDs (additional client IDs, job IDs, etc.) must reference valid records"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"At least one field must be provided (400 if request body is empty)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Replace behavior:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" When "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"additionalClientIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is provided, it fully replaces"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the existing associations — it is not additive. When "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is provided without"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"additionalClientIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the existing additional clients are preserved."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Nullable fields (e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"secondaryContactId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"endDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") cannot be"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"explicitly cleared to null via this endpoint — omitting them leaves the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"existing value unchanged."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"id\": 12345\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"id\": 12345\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"engagementId","in":"path","schemaId":"schema_35","description":"Unique identifier of the engagement to update","required":true,"example":12345}],"pointer":"/paths/~1api~1v1~1engagements~1{engagementId}/patch/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_36","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody/content/application~1json/example"]}},"schemaId":"schema_36","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"PATCH","path":"/api/v1/engagements/{engagementId}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"engagementId","in":"path","required":true,"example":12345,"schemaId":"schema_35"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_36","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/engagements/{engagementId}","href":"engagement/updateengagement","openApiOperationId":"updateEngagement","summary":"Update an existing engagement","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_36","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_36","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Engagement updated successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_37"}},"schemaId":"schema_37"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Bad request — no update fields provided, one or more IDs are invalid, or the engagement's status does not allow updates"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_38","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/no_fields","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_clients","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_jobs","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/status_locked"]}},"schemaId":"schema_38","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/no_fields","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_clients","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_jobs","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/status_locked"]},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unauthorized — invalid or missing authentication token"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden — insufficient permissions (requires ROLE_ENG_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Engagement not found","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_39","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/404/content/application~1json/examples/not_found"]}},"schemaId":"schema_39","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/404/content/application~1json/examples/not_found"]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1engagements~1{engagementId}/patch/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_37","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_37"}}},{"code":"400","schemaId":"schema_38","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/no_fields","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_clients","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_jobs","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/status_locked"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_38","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/no_fields","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_clients","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_jobs","paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/status_locked"]}}},{"code":"401"},{"code":"403"},{"code":"404","schemaId":"schema_39","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/404/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_39","exampleIds":["paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/404/content/application~1json/examples/not_found"]}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/updateengagement"}],"panels":[]}]},"httpPath":"/api/v1/engagements/{engagementId}"},{"label":"Create a single engagement","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/createengagementletter","routeSlug":"/bundle/engagement/createengagementletter","metadata":{"seo":{"title":"Create a single engagement","description":"🔐 Required role: ENG_C📖 Data dictionary: Engagement"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"createEngagementLetter","name":"Create a single engagement","isWebhook":false,"pointer":"/paths/~1api~1v1~1engagements~1create/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create a single engagement","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ENG_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create a single engagement letter"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates an engagement letter for a specific client. The engagement letter"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"will be associated with the specified client, fiscal year, and assigned staff."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required fields:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the client for whom the engagement is being created"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"fiscalYear"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the fiscal year of the engagement"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"partnerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the partner staff member assigned to the engagement"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"managerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the manager staff member assigned to the engagement"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"primaryContactId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the primary client contact"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagementLetterTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"documentTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the template to use. At least one"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"of the two must be provided; a request with neither is rejected."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Optional fields:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagementNameTemplate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — override the firm's default naming template"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"startDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"endDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — engagement date range"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingContactId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — contact responsible for billing"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"secondaryContactId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — secondary client contact"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ccStaffIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — additional staff members to CC on the engagement"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"additionalClientIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — additional clients to associate with the engagement"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — jobs/projects to link to the engagement"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"additionalDocuments"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — extra documents to attach to the engagement, each requiring a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"documentTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"documentType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CONSENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ADD_ON"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_40","exampleIds":["paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/full"]}},"schemaId":"schema_40","exampleIds":["paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/full"],"pointer":"/paths/~1api~1v1~1engagements~1create/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/engagements/create","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_40","exampleIds":["paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/full"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/engagements/create","href":"engagement/createengagementletter","openApiOperationId":"createEngagementLetter","summary":"Create a single engagement","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_40","exampleIds":["paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/full"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_40","exampleIds":["paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/full"]}},"examples":[{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Engagement letter created successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_41","exampleIds":["paths/~1api~1v1~1engagements~1create/post/responses/200/content/application~1json/examples/success"]}},"schemaId":"schema_41","exampleIds":["paths/~1api~1v1~1engagements~1create/post/responses/200/content/application~1json/examples/success"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invalid input data. A missing required field ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fiscalYear"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"partnerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"managerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"primaryContactId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"documentTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on an additional document)"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"message\": \"Validation failed\", \"extensions\": {\"code\": 400, \"details\": {\"reason\": \"VALIDATION_FAILED\", \"fieldErrors\": [{\"field\": \"clientId\", \"message\": \"clientId is required\"}]}}}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Also returned when the request names neither a document template nor an engagement letter"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"template: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"message\": \"Sorry, Engagement letter must have a Document Template or Engagement Letter Template specified.\", \"extensions\": {\"code\": 400, \"details\": null}}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"401","description":"Unauthorized - invalid or missing authentication token."},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires ROLE_ENG_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1engagements~1create/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_41","exampleIds":["paths/~1api~1v1~1engagements~1create/post/responses/200/content/application~1json/examples/success"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_41","exampleIds":["paths/~1api~1v1~1engagements~1create/post/responses/200/content/application~1json/examples/success"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/createengagementletter"}],"panels":[]}]},"httpPath":"/api/v1/engagements/create"},{"label":"Create a batch of engagements","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/createbatchengagementletters","routeSlug":"/bundle/engagement/createbatchengagementletters","metadata":{"seo":{"title":"Create a batch of engagements","description":"🔐 Required role: ENG_C📖 Data dictionary: Engagement"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"createBatchEngagementLetters","name":"Create a batch of engagements","isWebhook":false,"pointer":"/paths/~1api~1v1~1engagements~1batch~1create/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create a batch of engagements","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ENG_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create a batch of engagement letters asynchronously"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Submits a batch of engagement letter creation requests. The batch is processed"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"asynchronously — use the returned batch ID with the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/engagements/batch/{batchId}/status"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" endpoint to poll for completion"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and retrieve the IDs of the created engagements."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch-level options:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"name"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — optional label for the batch"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — apply a single project template to every engagement in the batch"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"includeAdditionalClients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — include additional clients when creating engagements"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"batchEngagements"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — array of individual engagement records (required)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Constraint:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" You may provide either "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (top-level) "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"or"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"on individual engagements — not both."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_42","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/with_project_template"]}},"schemaId":"schema_42","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/with_project_template"],"pointer":"/paths/~1api~1v1~1engagements~1batch~1create/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/engagements/batch/create","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_42","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/with_project_template"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/engagements/batch/create","href":"engagement/createbatchengagementletters","openApiOperationId":"createBatchEngagementLetters","summary":"Create a batch of engagements","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_42","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/with_project_template"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_42","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/with_project_template"]}},"examples":[{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch created successfully — process is asynchronous"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_43","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/responses/200/content/application~1json/examples/success"]}},"schemaId":"schema_43","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/responses/200/content/application~1json/examples/success"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invalid input data, for example:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"both "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and per-engagement "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" were provided"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"an entry is missing "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fiscalYear"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"primaryContactId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"reason\": \"VALIDATION_FAILED\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fieldErrors"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" such as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"batchEngagements[0].clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"entries name clients that do not exist: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"message\": \"Invalid client IDs: 999999\", \"extensions\": {\"code\": 400, \"details\": null}}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", listing every unknown id"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"an entry omits "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"partnerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"managerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the client has no default partner or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"manager: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"message\": \"Client 1001 has no default partner. Set partnerStaffId on the batch record.\", \"extensions\": {\"code\": 400, \"details\": null}}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (or the manager equivalent)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires ROLE_ENG_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1engagements~1batch~1create/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_43","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/responses/200/content/application~1json/examples/success"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_43","exampleIds":["paths/~1api~1v1~1engagements~1batch~1create/post/responses/200/content/application~1json/examples/success"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/createbatchengagementletters"}],"panels":[]}]},"httpPath":"/api/v1/engagements/batch/create"},{"label":"Get engagement batch status","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/getengagementbatchstatus","routeSlug":"/bundle/engagement/getengagementbatchstatus","metadata":{"seo":{"title":"Get engagement batch status","description":"🔐 Required role: ENG_C📖 Data dictionary: Engagement"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getEngagementBatchStatus","name":"Get engagement batch status","isWebhook":false,"pointer":"/paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get engagement batch status","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ENG_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve the status of an engagement batch"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the current processing status of a previously submitted engagement batch,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"along with the IDs of any engagements that have been created so far."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Use this endpoint to poll for completion after calling"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/engagements/batch/create"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch statuses:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"DRAFT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — batch has been recorded but processing has not started"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"CREATING"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — engagements are actively being created"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"CREATED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — all engagements in the batch have been created successfully"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"CANCELED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the batch was canceled before completion"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"batchId","in":"path","schemaId":"schema_35","description":"Unique identifier of the engagement batch","required":true,"example":9001}],"pointer":"/paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/engagements/batch/{batchId}/status","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"batchId","in":"path","required":true,"example":9001,"schemaId":"schema_35"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","401","403","404","500"],"pointer":"/api/v1/engagements/batch/{batchId}/status","href":"engagement/getengagementbatchstatus","openApiOperationId":"getEngagementBatchStatus","summary":"Get engagement batch status","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Batch status retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_44","exampleIds":["paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/in_progress","paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/completed"]}},"schemaId":"schema_44","exampleIds":["paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/in_progress","paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/completed"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires ROLE_ENG_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Batch not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_44","exampleIds":["paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/in_progress","paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/completed"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_44","exampleIds":["paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/in_progress","paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/completed"]}}},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/getengagementbatchstatus"}],"panels":[]}]},"httpPath":"/api/v1/engagements/batch/{batchId}/status"},{"label":"Get engagement documents by engagement ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/engagement/getengagementdocumentsbyengagementid","routeSlug":"/bundle/engagement/getengagementdocumentsbyengagementid","metadata":{"seo":{"title":"Get engagement documents by engagement ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Engagement document"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getEngagementDocumentsByEngagementId","name":"Get engagement documents by engagement ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get engagement documents by engagement ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/engagement-document"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement document"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve documents associated with a specific engagement"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns all engagement documents linked to the given engagement ID, including"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the document type name for each record."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"engagementId","in":"path","schemaId":"schema_11","description":"Unique identifier of the engagement","required":true,"example":34567}],"pointer":"/paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/engagement_documents/by_engagement/{engagementId}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"engagementId","in":"path","required":true,"example":34567,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","401","403","500"],"pointer":"/gql/v1/engagement_documents/by_engagement/{engagementId}","href":"engagement/getengagementdocumentsbyengagementid","openApiOperationId":"getEngagementDocumentsByEngagementId","summary":"Get engagement documents by engagement ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Engagement documents retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_45","exampleIds":["paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/responses/200/content/application~1json/examples/success"]}},"schemaId":"schema_45","exampleIds":["paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/responses/200/content/application~1json/examples/success"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_45","exampleIds":["paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/responses/200/content/application~1json/examples/success"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_45","exampleIds":["paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/responses/200/content/application~1json/examples/success"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/engagement/getengagementdocumentsbyengagementid"}],"panels":[]}]},"httpPath":"/gql/v1/engagement_documents/by_engagement/{engagementId}"}],"content":{"contentType":"group","meta":{"name":"Engagement"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Engagement","showPageActions":true},{"nodeType":"markdoc","content":"Create, send, and track engagements."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/engagements","summary":"List engagements","prefix":{"name":"post","color":"post"},"badges":[],"link":"/engagement/getengagements","deprecated":false},{"title":"/gql/v1/engagements/search","summary":"Search engagements","prefix":{"name":"post","color":"post"},"badges":[],"link":"/engagement/searchengagementsdynamic","deprecated":false},{"title":"/gql/v1/engagement/{id}","summary":"Get engagement by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/engagement/getengagementbyid","deprecated":false},{"title":"/api/v1/engagements/{engagementId}","summary":"Update an existing engagement","prefix":{"name":"patch","color":"patch"},"badges":[],"link":"/engagement/updateengagement","deprecated":false},{"title":"/api/v1/engagements/create","summary":"Create a single engagement","prefix":{"name":"post","color":"post"},"badges":[],"link":"/engagement/createengagementletter","deprecated":false},{"title":"/api/v1/engagements/batch/create","summary":"Create a batch of engagements","prefix":{"name":"post","color":"post"},"badges":[],"link":"/engagement/createbatchengagementletters","deprecated":false},{"title":"/api/v1/engagements/batch/{batchId}/status","summary":"Get engagement batch status","prefix":{"name":"get","color":"get"},"badges":[],"link":"/engagement/getengagementbatchstatus","deprecated":false},{"title":"/gql/v1/engagement_documents/by_engagement/{engagementId}","summary":"Get engagement documents by engagement ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/engagement/getengagementdocumentsbyengagementid","deprecated":false}]}]}]}]}},{"type":"group","label":"Projects","link":"/bundle/projects","routeSlug":"/bundle/projects","items":[{"label":"List projects","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/projects/getprojectspaginated","routeSlug":"/bundle/projects/getprojectspaginated","metadata":{"seo":{"title":"List projects","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Project"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getProjectsPaginated","name":"List projects","isWebhook":false,"pointer":"/paths/~1gql~1v1~1projects/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List projects","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/project"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all projects with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default ordering by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"updatedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" desc."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1projects/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1projects/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1projects/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/projects","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1projects/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/projects","href":"projects/getprojectspaginated","openApiOperationId":"getProjectsPaginated","summary":"List projects","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1projects/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1projects/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved projects","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ProjectListResponse"}},"schemaId":"components/schemas/ProjectListResponse"},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1projects/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/ProjectListResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ProjectListResponse"}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/projects/getprojectspaginated"}],"panels":[]}]},"httpPath":"/gql/v1/projects"},{"label":"Search projects","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/projects/filterprojectsdynamic","routeSlug":"/bundle/projects/filterprojectsdynamic","metadata":{"seo":{"title":"Search projects","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Project"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterProjectsDynamic","name":"Search projects","isWebhook":false,"pointer":"/paths/~1gql~1v1~1projects~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search projects","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/project"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced project filtering with a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Projects are stored in the Jobs table (vw_job view). Supports manager, dates, and flags."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"orderBy"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" use the project field names of the response (camelCase, for example"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"status"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"isActive"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"partnerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"managerStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"updatedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"); an unknown field is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rejected with 400. The response holds the matching rows in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projects"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the number of"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projects matching "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_46","exampleIds":["paths/~1gql~1v1~1projects~1search/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_46","exampleIds":["paths/~1gql~1v1~1projects~1search/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1gql~1v1~1projects~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/projects/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_46","exampleIds":["paths/~1gql~1v1~1projects~1search/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/projects/search","href":"projects/filterprojectsdynamic","openApiOperationId":"filterProjectsDynamic","summary":"Search projects","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_46","exampleIds":["paths/~1gql~1v1~1projects~1search/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_46","exampleIds":["paths/~1gql~1v1~1projects~1search/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved filtered projects","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ProjectListResponse","exampleIds":["paths/~1gql~1v1~1projects~1search/post/responses/200/content/application~1json/examples/projects"]}},"schemaId":"components/schemas/ProjectListResponse","exampleIds":["paths/~1gql~1v1~1projects~1search/post/responses/200/content/application~1json/examples/projects"]},{"code":"400","description":"Bad request - invalid where/orderBy","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_47"}},"schemaId":"schema_47"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1projects~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/ProjectListResponse","exampleIds":["paths/~1gql~1v1~1projects~1search/post/responses/200/content/application~1json/examples/projects"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ProjectListResponse","exampleIds":["paths/~1gql~1v1~1projects~1search/post/responses/200/content/application~1json/examples/projects"]}}},{"code":"400","schemaId":"schema_47","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_47"}}},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/projects/filterprojectsdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/projects/search"},{"label":"Get project by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/projects/getprojectbyid","routeSlug":"/bundle/projects/getprojectbyid","metadata":{"seo":{"title":"Get project by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Project"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getProjectById","name":"Get project by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1project~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get project by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/project"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific project by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The project is returned in a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"project"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" array that holds at most one row, with the same"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"row shape as the project list and search operations: dates, status, fee structure,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client, project owner, partner and service lines."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"An id that matches no project returns 200 with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"project\": []"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; this operation never"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns 404. A non-numeric id returns 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"project\": [\n    {\n      \"id\": 1703,\n      \"name\": \"Tax: General Tax Consulting\",\n      \"startDate\": null,\n      \"endDate\": null,\n      \"dueDate\": null,\n      \"targetStartDate\": \"2026-10-08\",\n      \"targetedStartDate\": \"2026-10-08\",\n      \"targetEndDate\": \"2026-10-31\",\n      \"targetedEndDate\": \"2026-10-31\",\n      \"feeStructureId\": null,\n      \"pmsRef\": \"AIWYN_1703\",\n      \"isCreatedByAiwyn\": true,\n      \"managerStaffId\": null,\n      \"partnerStaffId\": null,\n      \"serviceId\": null,\n      \"serviceDescription\": \"Tax: General Tax Consulting\",\n      \"extendedServiceDescription\": null,\n      \"status\": \"DRAFT\",\n      \"createdAt\": \"2026-10-08T15:17:05.651201+00:00\",\n      \"updatedAt\": \"2026-10-08T15:17:05.685193+00:00\",\n      \"customFieldValues\": null,\n      \"sysRefs\": {},\n      \"feeStructureV4\": null,\n      \"client\": { \"id\": 281, \"name\": \"Ettore Test Over\", \"clientRef\": \"9001726\" },\n      \"projectOwner\": null,\n      \"partnerStaff\": null,\n      \"jobServiceLines\": []\n    }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"project\": [\n    {\n      \"id\": 1703,\n      \"name\": \"Tax: General Tax Consulting\",\n      \"startDate\": null,\n      \"endDate\": null,\n      \"dueDate\": null,\n      \"targetStartDate\": \"2026-10-08\",\n      \"targetedStartDate\": \"2026-10-08\",\n      \"targetEndDate\": \"2026-10-31\",\n      \"targetedEndDate\": \"2026-10-31\",\n      \"feeStructureId\": null,\n      \"pmsRef\": \"AIWYN_1703\",\n      \"isCreatedByAiwyn\": true,\n      \"managerStaffId\": null,\n      \"partnerStaffId\": null,\n      \"serviceId\": null,\n      \"serviceDescription\": \"Tax: General Tax Consulting\",\n      \"extendedServiceDescription\": null,\n      \"status\": \"DRAFT\",\n      \"createdAt\": \"2026-10-08T15:17:05.651201+00:00\",\n      \"updatedAt\": \"2026-10-08T15:17:05.685193+00:00\",\n      \"customFieldValues\": null,\n      \"sysRefs\": {},\n      \"feeStructureV4\": null,\n      \"client\": { \"id\": 281, \"name\": \"Ettore Test Over\", \"clientRef\": \"9001726\" },\n      \"projectOwner\": null,\n      \"partnerStaff\": null,\n      \"jobServiceLines\": []\n    }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the project","required":true,"example":1703}],"pointer":"/paths/~1gql~1v1~1project~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/project/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":1703,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/project/{id}","href":"projects/getprojectbyid","openApiOperationId":"getProjectById","summary":"Get project by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project lookup completed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"project"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" holds the project, or is empty when no project"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"has this id."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_48","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_48","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}},"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this project"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1project~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_48","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_48","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1project~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/projects/getprojectbyid"}],"panels":[]}]},"httpPath":"/gql/v1/project/{id}"},{"label":"Create one or more jobs from job templates","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/projects/createprojectsfromtemplate","routeSlug":"/bundle/projects/createprojectsfromtemplate","metadata":{"seo":{"title":"Create one or more jobs from job templates","description":"🔐 Required role: PROJ_C📖 Data dictionary: Project"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"createProjectsFromTemplate","name":"Create one or more jobs from job templates","isWebhook":false,"pointer":"/paths/~1api~1v1~1projects~1create_from_template/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create one or more jobs from job templates","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PROJ_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/project"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create jobs from job templates"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates one or more jobs for a client from job templates. Up to 100 templates"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"may be provided in a single request. Each entry in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobTemplates"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" can override"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"field-level defaults defined on the template."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required fields:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the client for whom the jobs are being created"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobTemplates"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — list of job templates to instantiate (1–100 entries)"},"children":[],"type":"text"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the template to create a job from"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Optional per-template overrides"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (each overrides the template default if provided):"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"startDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — job start date"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"name"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — job name"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"serviceDescription"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — service description"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"estimationHours"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — estimated hours"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"feeAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — fee amount"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"requiredPrepayment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — required prepayment amount"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"includeWipType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — WIP billing behavior ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INCLUDE_WIP"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INCLUDE_WIP_IF_FINAL"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DO_NOT_INCLUDE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_49","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/full"]}},"schemaId":"schema_49","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/full"],"pointer":"/paths/~1api~1v1~1projects~1create_from_template/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/projects/create_from_template","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_49","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/full"]}},"responseCodes":["201","400","401","403","500"],"pointer":"/api/v1/projects/create_from_template","href":"projects/createprojectsfromtemplate","openApiOperationId":"createProjectsFromTemplate","summary":"Create one or more jobs from job templates","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_49","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/full"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_49","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/full"]}},"examples":[{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"201","description":"Jobs created successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_50","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/responses/201/content/application~1json/examples/success"]}},"schemaId":"schema_50","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/responses/201/content/application~1json/examples/success"]},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires ROLE_PROJ_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1projects~1create_from_template/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"201","schemaId":"schema_50","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/responses/201/content/application~1json/examples/success"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_50","exampleIds":["paths/~1api~1v1~1projects~1create_from_template/post/responses/201/content/application~1json/examples/success"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/projects/createprojectsfromtemplate"}],"panels":[]}]},"httpPath":"/api/v1/projects/create_from_template"},{"label":"Assign staff to a project","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/projects/assignstafftoproject","routeSlug":"/bundle/projects/assignstafftoproject","metadata":{"seo":{"title":"Assign staff to a project","description":"🔐 Required role: PROJ_C📖 Data dictionary: Project"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"AssignStaffToProject","name":"Assign staff to a project","isWebhook":false,"pointer":"/paths/~1api~1v1~1projects~1assign_staff/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Assign staff to a project","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PROJ_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/project"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Assign staff to a project"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates associations between staff members and a job:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffJobAssignments"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": assigns staff directly to the job via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff_job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffTaskAssignments"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": assigns staff to specific task types on the job via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_type_staff_job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"If an association already exists but is inactive, it will be re-activated."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the IDs of created or re-activated records as"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"staffJobIds\": [<staff_job id>, ...], \"staffTaskIds\": [<task_type_staff_job id>, ...]}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1assign_staff/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1assign_staff/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1projects~1assign_staff/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/projects/assign_staff","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1assign_staff/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/projects/assign_staff","href":"projects/assignstafftoproject","openApiOperationId":"AssignStaffToProject","summary":"Assign staff to a project","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1assign_staff/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1assign_staff/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Staff assigned successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_52"}},"schemaId":"schema_52"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires PROJ_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Job, staff, or task type not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1projects~1assign_staff/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_52","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_52"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/projects/assignstafftoproject"}],"panels":[]}]},"httpPath":"/api/v1/projects/assign_staff"},{"label":"Remove staff from a project","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/projects/removestafffromproject","routeSlug":"/bundle/projects/removestafffromproject","metadata":{"seo":{"title":"Remove staff from a project","description":"🔐 Required role: PROJ_C📖 Data dictionary: Project"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"RemoveStaffFromProject","name":"Remove staff from a project","isWebhook":false,"pointer":"/paths/~1api~1v1~1projects~1remove_staff/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Remove staff from a project","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PROJ_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/project"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Remove staff from a project"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Deactivates associations between staff members and a job:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffJobAssignments"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": deactivates matching "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff_job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffTaskAssignments"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": deactivates matching "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_type_staff_job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the IDs of deactivated records, in the same shape as the assign endpoint's response."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Items with no matching active record are silently skipped."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1remove_staff/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1remove_staff/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1projects~1remove_staff/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/projects/remove_staff","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1remove_staff/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/projects/remove_staff","href":"projects/removestafffromproject","openApiOperationId":"RemoveStaffFromProject","summary":"Remove staff from a project","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1remove_staff/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_51","exampleIds":["paths/~1api~1v1~1projects~1remove_staff/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Staff removed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_52"}},"schemaId":"schema_52"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires PROJ_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Job, staff, or task type not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1projects~1remove_staff/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_52","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_52"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/projects/removestafffromproject"}],"panels":[]}]},"httpPath":"/api/v1/projects/remove_staff"}],"content":{"contentType":"group","meta":{"name":"Projects"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Projects","showPageActions":true},{"nodeType":"markdoc","content":"Handle engagements, projects, and workflow tracking."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/projects","summary":"List projects","prefix":{"name":"post","color":"post"},"badges":[],"link":"/projects/getprojectspaginated","deprecated":false},{"title":"/gql/v1/projects/search","summary":"Search projects","prefix":{"name":"post","color":"post"},"badges":[],"link":"/projects/filterprojectsdynamic","deprecated":false},{"title":"/gql/v1/project/{id}","summary":"Get project by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/projects/getprojectbyid","deprecated":false},{"title":"/api/v1/projects/create_from_template","summary":"Create one or more jobs from job templates","prefix":{"name":"post","color":"post"},"badges":[],"link":"/projects/createprojectsfromtemplate","deprecated":false},{"title":"/api/v1/projects/assign_staff","summary":"Assign staff to a project","prefix":{"name":"post","color":"post"},"badges":[],"link":"/projects/assignstafftoproject","deprecated":false},{"title":"/api/v1/projects/remove_staff","summary":"Remove staff from a project","prefix":{"name":"post","color":"post"},"badges":[],"link":"/projects/removestafffromproject","deprecated":false}]}]}]}]}},{"type":"group","label":"Job","link":"/bundle/job","routeSlug":"/bundle/job","items":[{"label":"List jobs","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/job/getjobspaginated","routeSlug":"/bundle/job/getjobspaginated","metadata":{"seo":{"title":"List jobs","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Job"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getJobsPaginated","name":"List jobs","isWebhook":false,"pointer":"/paths/~1gql~1v1~1jobs/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List jobs","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/job"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Job"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all jobs with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1jobs/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1jobs/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1jobs/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/jobs","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1jobs/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/jobs","href":"job/getjobspaginated","openApiOperationId":"getJobsPaginated","summary":"List jobs","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1jobs/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1jobs/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved jobs","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_53","exampleIds":["paths/~1gql~1v1~1jobs/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_53","exampleIds":["paths/~1gql~1v1~1jobs/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1jobs/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_53","exampleIds":["paths/~1gql~1v1~1jobs/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_53","exampleIds":["paths/~1gql~1v1~1jobs/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/job/getjobspaginated"}],"panels":[]}]},"httpPath":"/gql/v1/jobs"},{"label":"Get job by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/job/getjobbyid","routeSlug":"/bundle/job/getjobbyid","metadata":{"seo":{"title":"Get job by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Job"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getJobById","name":"Get job by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1job~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get job by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/job"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Job"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific job by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the job","required":true,"example":5012}],"pointer":"/paths/~1gql~1v1~1job~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/job/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":5012,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","401","500"],"pointer":"/gql/v1/job/{id}","href":"job/getjobbyid","openApiOperationId":"getJobById","summary":"Get job by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Job details retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_54","exampleIds":["paths/~1gql~1v1~1job~1{id}/get/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_54","exampleIds":["paths/~1gql~1v1~1job~1{id}/get/responses/200/content/application~1json/examples/sample"]},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1job~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_54","exampleIds":["paths/~1gql~1v1~1job~1{id}/get/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_54","exampleIds":["paths/~1gql~1v1~1job~1{id}/get/responses/200/content/application~1json/examples/sample"]}}},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/job/getjobbyid"}],"panels":[]}]},"httpPath":"/gql/v1/job/{id}"}],"content":{"contentType":"group","meta":{"name":"Job"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Job","showPageActions":true},{"nodeType":"markdoc","content":"Manage jobs and projects."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/jobs","summary":"List jobs","prefix":{"name":"post","color":"post"},"badges":[],"link":"/job/getjobspaginated","deprecated":false},{"title":"/gql/v1/job/{id}","summary":"Get job by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/job/getjobbyid","deprecated":false}]}]}]}]}},{"type":"group","label":"Job template","link":"/bundle/job-template","routeSlug":"/bundle/job-template","items":[{"label":"List job templates","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/job-template/getjobtemplatespaginated","routeSlug":"/bundle/job-template/getjobtemplatespaginated","metadata":{"seo":{"title":"List job templates","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Job template"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getJobTemplatesPaginated","name":"List job templates","isWebhook":false,"pointer":"/paths/~1gql~1v1~1job_templates/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List job templates","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/job-template"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Job template"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all job templates with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1job_templates/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1job_templates/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1job_templates/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/job_templates","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1job_templates/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/job_templates","href":"job-template/getjobtemplatespaginated","openApiOperationId":"getJobTemplatesPaginated","summary":"List job templates","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1job_templates/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1job_templates/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved job templates","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_55","exampleIds":["paths/~1gql~1v1~1job_templates/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_55","exampleIds":["paths/~1gql~1v1~1job_templates/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1job_templates/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_55","exampleIds":["paths/~1gql~1v1~1job_templates/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_55","exampleIds":["paths/~1gql~1v1~1job_templates/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/job-template/getjobtemplatespaginated"}],"panels":[]}]},"httpPath":"/gql/v1/job_templates"}],"content":{"contentType":"group","meta":{"name":"Job Template"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Job template","showPageActions":true},{"nodeType":"markdoc","content":"Manage job templates."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/job_templates","summary":"List job templates","prefix":{"name":"post","color":"post"},"badges":[],"link":"/job-template/getjobtemplatespaginated","deprecated":false}]}]}]}]}},{"type":"separator","label":"Billing & payments","content":null},{"type":"group","label":"Billing","link":"/bundle/billing","routeSlug":"/bundle/billing","items":[{"label":"List draft invoice histories","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/billing/getdraftinvoicehistoriespaginated","routeSlug":"/bundle/billing/getdraftinvoicehistoriespaginated","metadata":{"seo":{"title":"List draft invoice histories","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Draft invoice history"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getDraftInvoiceHistoriesPaginated","name":"List draft invoice histories","isWebhook":false,"pointer":"/paths/~1gql~1v1~1draft_invoice_histories/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List draft invoice histories","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/draft-invoice-history"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Draft invoice history"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve draft invoice histories with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Provides paginated access to draft invoice history records."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1draft_invoice_histories/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/draft_invoice_histories","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/draft_invoice_histories","href":"billing/getdraftinvoicehistoriespaginated","openApiOperationId":"getDraftInvoiceHistoriesPaginated","summary":"List draft invoice histories","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved draft invoice histories","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/responses/200/content/application~1json/examples/successful_response"]}},"schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/responses/200/content/application~1json/examples/successful_response"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1draft_invoice_histories/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/responses/200/content/application~1json/examples/successful_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories/post/responses/200/content/application~1json/examples/successful_response"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/billing/getdraftinvoicehistoriespaginated"}],"panels":[]}]},"httpPath":"/gql/v1/draft_invoice_histories"},{"label":"Search draft invoice histories","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/billing/filterdraftinvoicehistoriesdynamic","routeSlug":"/bundle/billing/filterdraftinvoicehistoriesdynamic","metadata":{"seo":{"title":"Search draft invoice histories","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Draft invoice history"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterDraftInvoiceHistoriesDynamic","name":"Search draft invoice histories","isWebhook":false,"pointer":"/paths/~1gql~1v1~1draft_invoice_histories~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search draft invoice histories","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/draft-invoice-history"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Draft invoice history"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced draft invoice history filtering with a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports client, invoice, job filtering and draftInvoice approvedAt date range."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_56","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_56","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/draft_invoice_histories/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_56","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/draft_invoice_histories/search","href":"billing/filterdraftinvoicehistoriesdynamic","openApiOperationId":"filterDraftInvoiceHistoriesDynamic","summary":"Search draft invoice histories","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_56","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_56","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved filtered draft invoice histories","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/responses/200/content/application~1json/examples/successful_response"]}},"schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/responses/200/content/application~1json/examples/successful_response"]},{"code":"400","description":"Bad request - invalid where/orderBy"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1draft_invoice_histories~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/responses/200/content/application~1json/examples/successful_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/DraftInvoiceHistoryListResponse","exampleIds":["paths/~1gql~1v1~1draft_invoice_histories~1search/post/responses/200/content/application~1json/examples/successful_response"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/billing/filterdraftinvoicehistoriesdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/draft_invoice_histories/search"},{"label":"Get draft invoice history by invoice ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/billing/getdraftinvoicehistorybyinvoiceid","routeSlug":"/bundle/billing/getdraftinvoicehistorybyinvoiceid","metadata":{"seo":{"title":"Get draft invoice history by invoice ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Draft invoice history"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getDraftInvoiceHistoryByInvoiceId","name":"Get draft invoice history by invoice ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1draft_invoice_history~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get draft invoice history by invoice ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/draft-invoice-history"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Draft invoice history"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve the draft invoice history record of a posted invoice"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" path parameter is an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoice id"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" of a draft"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoice history record, equal to the invoice's AR transaction id), not a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"draft invoice id or a history record id. The endpoint returns the first"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"draft invoice history record whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" equals "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The body is wrapped in a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"draft_invoice_history"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" array containing at most one"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"record. An id that matches no record returns 200 with an empty array; the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"endpoint never returns 404 for an unknown id."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"draft_invoice_history\": [\n    {\n      \"clientId\": 7720,\n      \"invoiceId\": 125890,\n      \"jobId\": 2514,\n      \"client\": {\n        \"active\": true,\n        \"clientRef\": \"TF-2024-789\",\n        \"name\": \"TechFlow Enterprises\",\n        \"pmsRef\": \"240815\"\n      },\n      \"draftInvoice\": {\n        \"approvedAt\": \"2024-03-15T14:32:18+00:00\",\n        \"arTranId\": 125880,\n        \"approverStaffId\": 301,\n        \"approvedByStaffId\": 301,\n        \"invoiceId\": 125890,\n        \"isActive\": true,\n        \"pms_invoice_number\": null,\n        \"status\": \"APPROVED\"\n      }\n    }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"draft_invoice_history\": [\n    {\n      \"clientId\": 7720,\n      \"invoiceId\": 125890,\n      \"jobId\": 2514,\n      \"client\": {\n        \"active\": true,\n        \"clientRef\": \"TF-2024-789\",\n        \"name\": \"TechFlow Enterprises\",\n        \"pmsRef\": \"240815\"\n      },\n      \"draftInvoice\": {\n        \"approvedAt\": \"2024-03-15T14:32:18+00:00\",\n        \"arTranId\": 125880,\n        \"approverStaffId\": 301,\n        \"approvedByStaffId\": 301,\n        \"invoiceId\": 125890,\n        \"isActive\": true,\n        \"pms_invoice_number\": null,\n        \"status\": \"APPROVED\"\n      }\n    }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice id ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") whose draft invoice history record is returned"},"children":[],"type":"text"}],"type":"paragraph"}],"required":true,"example":125890}],"pointer":"/paths/~1gql~1v1~1draft_invoice_history~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/draft_invoice_history/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":125890,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/draft_invoice_history/{id}","href":"billing/getdraftinvoicehistorybyinvoiceid","openApiOperationId":"getDraftInvoiceHistoryByInvoiceId","summary":"Get draft invoice history by invoice ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Draft invoice history lookup completed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"draft_invoice_history"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" holds the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"matching record, or is empty when no record has this "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_57","exampleIds":["paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_57","exampleIds":["paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_58"}},"schemaId":"schema_58"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access draft invoice histories"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_57","exampleIds":["paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_57","exampleIds":["paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_58","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_58"}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/billing/getdraftinvoicehistorybyinvoiceid"}],"panels":[]}]},"httpPath":"/gql/v1/draft_invoice_history/{id}"}],"content":{"contentType":"group","meta":{"name":"Billing"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Billing","showPageActions":true},{"nodeType":"markdoc","content":"Manage billing cycles, statements, and billing configurations."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/draft_invoice_histories","summary":"List draft invoice histories","prefix":{"name":"post","color":"post"},"badges":[],"link":"/billing/getdraftinvoicehistoriespaginated","deprecated":false},{"title":"/gql/v1/draft_invoice_histories/search","summary":"Search draft invoice histories","prefix":{"name":"post","color":"post"},"badges":[],"link":"/billing/filterdraftinvoicehistoriesdynamic","deprecated":false},{"title":"/gql/v1/draft_invoice_history/{id}","summary":"Get draft invoice history by invoice ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/billing/getdraftinvoicehistorybyinvoiceid","deprecated":false}]}]}]}]}},{"type":"group","label":"Invoices","link":"/bundle/invoices","routeSlug":"/bundle/invoices","items":[{"label":"List invoices","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/invoices/getinvoices","routeSlug":"/bundle/invoices/getinvoices","metadata":{"seo":{"title":"List invoices","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Invoice"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getInvoices","name":"List invoices","isWebhook":false,"pointer":"/paths/~1gql~1v1~1invoices/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List invoices","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/invoice"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve invoices with AR transaction data, paginated"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This operation accepts only "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; any other body property is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rejected with 400. To filter, use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/invoices/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint delivers complete invoice management functionality with:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination for large invoice datasets"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration with AR transactions for complete financial context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax, interest, and payment status tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client relationship data for each invoice"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aggregate counting for reporting and analytics"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Key Financial Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice status tracking (PENDING, PAID, OVERDUE, POSTED, etc.)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax and interest calculations included"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Due date monitoring for collections management"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AR transaction linkage for payment reconciliation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Amount and allocation tracking for financial reporting"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Ordering:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" newest first ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" desc), then "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumber"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" asc."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Accounts receivable management and aging reports"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client billing history and statement generation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Collections management and overdue tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Financial reporting and revenue recognition"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment reconciliation and allocation tracking"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1invoices/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1invoices/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1invoices/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/invoices","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1invoices/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/invoices","href":"invoices/getinvoices","openApiOperationId":"getInvoices","summary":"List invoices","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1invoices/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1invoices/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved invoice records","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_59","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"schema_59","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request - invalid pagination values or an unexpected body property","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/400/content/application~1json/examples/unexpected_variable"]}},"schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/400/content/application~1json/examples/unexpected_variable"]},{"code":"401","description":"Unauthorized - missing or invalid authentication token","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/401/content/application~1json/examples/missing_auth"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/401/content/application~1json/examples/missing_auth"]},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}},"schemaId":"schema_10"}],"pointer":"/paths/~1gql~1v1~1invoices/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_59","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_59","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400","schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/400/content/application~1json/examples/unexpected_variable"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/400/content/application~1json/examples/unexpected_variable"]}}},{"code":"401","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/401/content/application~1json/examples/missing_auth"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1invoices/post/responses/401/content/application~1json/examples/missing_auth"]}}},{"code":"500","schemaId":"schema_10","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/invoices/getinvoices"}],"panels":[]}]},"httpPath":"/gql/v1/invoices"},{"label":"Search invoices","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/invoices/filterinvoicesdynamic","routeSlug":"/bundle/invoices/filterinvoicesdynamic","metadata":{"seo":{"title":"Search invoices","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Invoice"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterInvoicesDynamic","name":"Search invoices","isWebhook":false,"pointer":"/paths/~1gql~1v1~1invoices~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search invoices","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/invoice"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced invoice filtering with a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports invoiceNumber text matching, status filtering, and date ranges."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_61","exampleIds":["paths/~1gql~1v1~1invoices~1search/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_61","exampleIds":["paths/~1gql~1v1~1invoices~1search/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1gql~1v1~1invoices~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/invoices/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_61","exampleIds":["paths/~1gql~1v1~1invoices~1search/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/invoices/search","href":"invoices/filterinvoicesdynamic","openApiOperationId":"filterInvoicesDynamic","summary":"Search invoices","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_61","exampleIds":["paths/~1gql~1v1~1invoices~1search/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_61","exampleIds":["paths/~1gql~1v1~1invoices~1search/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved filtered invoices","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_62"}},"schemaId":"schema_62"},{"code":"400","description":"Bad request - invalid where/orderBy"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1invoices~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_62","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_62"}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/invoices/filterinvoicesdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/invoices/search"},{"label":"Get invoice by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/invoices/getinvoicebyid","routeSlug":"/bundle/invoices/getinvoicebyid","metadata":{"seo":{"title":"Get invoice by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Invoice"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getInvoiceById","name":"Get invoice by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1invoice~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get invoice by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/invoice"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific invoice by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint provides detailed invoice information including:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Complete invoice details and line items"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice status and payment tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client and project relationships"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax calculations and compliance data"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment history and outstanding balances"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Document generation and delivery status"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice Management Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice lifecycle tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment status monitoring"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax calculation and compliance"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client relationship integration"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Document generation and delivery"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice Details Include:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice number and reference"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice status and payment status"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client and project information"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Line items and amounts"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax calculations"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment history"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice status monitoring"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment tracking and reconciliation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client billing history"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Revenue recognition analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tax compliance reporting"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The invoice is wrapped in an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoice"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" property. An id that matches no"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoice returns 200 with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"invoice\": null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; the endpoint never returns 404."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"invoice\": {\n    \"arTranId\": 45678,\n    \"invoiceNumber\": \"INV-2024-001\",\n    \"dueDate\": \"2024-12-31T23:59:59Z\",\n    \"status\": \"POSTED\",\n    \"tax\": 2000.00,\n    \"interest\": 0.00,\n    \"description\": \"Q4 Financial Audit\",\n    \"createdAt\": \"2024-12-01T09:00:00Z\",\n    \"updatedAt\": \"2024-12-15T10:30:00Z\",\n    \"ar_tran\": {\n      \"id\": 45678,\n      \"pmsRef\": \"AR-2024-045678\",\n      \"transactionDate\": \"2024-12-01T00:00:00Z\",\n      \"amount\": 22000.00,\n      \"allocated\": 15000.00,\n      \"clientId\": 789\n    }\n  }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"invoice\": {\n    \"arTranId\": 45678,\n    \"invoiceNumber\": \"INV-2024-001\",\n    \"dueDate\": \"2024-12-31T23:59:59Z\",\n    \"status\": \"POSTED\",\n    \"tax\": 2000.00,\n    \"interest\": 0.00,\n    \"description\": \"Q4 Financial Audit\",\n    \"createdAt\": \"2024-12-01T09:00:00Z\",\n    \"updatedAt\": \"2024-12-15T10:30:00Z\",\n    \"ar_tran\": {\n      \"id\": 45678,\n      \"pmsRef\": \"AR-2024-045678\",\n      \"transactionDate\": \"2024-12-01T00:00:00Z\",\n      \"amount\": 22000.00,\n      \"allocated\": 15000.00,\n      \"clientId\": 789\n    }\n  }\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the invoice","required":true,"example":45678}],"pointer":"/paths/~1gql~1v1~1invoice~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/invoice/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":45678,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/invoice/{id}","href":"invoices/getinvoicebyid","openApiOperationId":"getInvoiceById","summary":"Get invoice by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice lookup completed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoice"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the invoice, or null when no invoice"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"has this id."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_63","exampleIds":["paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_63","exampleIds":["paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_64"}},"schemaId":"schema_64"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this invoice"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1invoice~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_63","exampleIds":["paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_63","exampleIds":["paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_64","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_64"}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/invoices/getinvoicebyid"}],"panels":[]}]},"httpPath":"/gql/v1/invoice/{id}"},{"label":"List a client's unpaid invoices","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/invoices/getunpaidinvoicesbyclientref","routeSlug":"/bundle/invoices/getunpaidinvoicesbyclientref","metadata":{"seo":{"title":"List a client's unpaid invoices","description":"🔐 Required role: INVC_R or API_ADMIN📖 Data dictionary: Invoice"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getUnpaidInvoicesByClientRef","name":"List a client's unpaid invoices","isWebhook":false,"pointer":"/paths/~1api~1v1~1invoices~1unpaid/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List a client's unpaid invoices","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INVC_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/invoice"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Return the unpaid invoices of one client, resolved by client reference"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The client is resolved by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the same identifier "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/clients/v1/link/payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"accepts, and the invoices returned are exactly the ones that endpoint accepts in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": active invoices whose amount is larger than what has been allocated to them so"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"far. Fully paid, reversed, inactive and unposted (draft) invoices are not returned. Invoices are ordered by due date,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"then invoice number."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Amounts are decimal strings in the firm's currency. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"outstanding"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount - allocated"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" of each invoice is the value to pass as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when creating a payment link."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"clientRef","in":"query","schemaId":"schema_65","description":"Client reference of the client whose unpaid invoices are requested.","required":true,"example":"ACME-001"}],"pointer":"/paths/~1api~1v1~1invoices~1unpaid/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/invoices/unpaid","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[{"name":"clientRef","in":"query","required":true,"example":"ACME-001","schemaId":"schema_65"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/invoices/unpaid","href":"invoices/getunpaidinvoicesbyclientref","openApiOperationId":"getUnpaidInvoicesByClientRef","summary":"List a client's unpaid invoices","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Client resolved and its unpaid invoices returned","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_66","exampleIds":["paths/~1api~1v1~1invoices~1unpaid/get/responses/200/content/application~1json/example"]}},"schemaId":"schema_66","exampleIds":["paths/~1api~1v1~1invoices~1unpaid/get/responses/200/content/application~1json/example"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" blank ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CLIENT_REF_REQUIRED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), more than one client carries that reference"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CLIENT_REF_AMBIGUOUS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), or the client is inactive ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CLIENT_INACTIVE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). The code is in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error.code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires INVC_R or API_ADMIN)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No client with that reference ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error.code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CLIENT_NOT_FOUND"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1invoices~1unpaid/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_66","exampleIds":["paths/~1api~1v1~1invoices~1unpaid/get/responses/200/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_66","exampleIds":["paths/~1api~1v1~1invoices~1unpaid/get/responses/200/content/application~1json/example"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/invoices/getunpaidinvoicesbyclientref"}],"panels":[]}]},"httpPath":"/api/v1/invoices/unpaid"}],"content":{"contentType":"group","meta":{"name":"Invoices"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Invoices","showPageActions":true},{"nodeType":"markdoc","content":"Create, send, and manage invoices."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/invoices","summary":"List invoices","prefix":{"name":"post","color":"post"},"badges":[],"link":"/invoices/getinvoices","deprecated":false},{"title":"/gql/v1/invoices/search","summary":"Search invoices","prefix":{"name":"post","color":"post"},"badges":[],"link":"/invoices/filterinvoicesdynamic","deprecated":false},{"title":"/gql/v1/invoice/{id}","summary":"Get invoice by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/invoices/getinvoicebyid","deprecated":false},{"title":"/api/v1/invoices/unpaid","summary":"List a client's unpaid invoices","prefix":{"name":"get","color":"get"},"badges":[],"link":"/invoices/getunpaidinvoicesbyclientref","deprecated":false}]}]}]}]}},{"type":"group","label":"Payments","link":"/bundle/payments","routeSlug":"/bundle/payments","items":[{"label":"List payments","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/payments/getpayments","routeSlug":"/bundle/payments/getpayments","metadata":{"seo":{"title":"List payments","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Payment"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getPayments","name":"List payments","isWebhook":false,"pointer":"/paths/~1gql~1v1~1payments/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List payments","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/payment"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve payment records with transaction details and security compliance"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This operation accepts only "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; any other body property is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rejected with 400. To filter, use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/payments/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination (v1 — limit/offset, see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"):"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a limit (records to return)."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an offset (records to skip), not a page index. Hasura maps these as"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit: $pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"offset: $page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is at or beyond"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the result array is empty."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint provides secure payment data access with:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PCI-compliant payment information (masked card data)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment method categorization and tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration with AR transactions for complete context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment processor integration (PayPal, Stripe, etc.)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client relationship data for payment attribution"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Security & Compliance:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PCI DSS compliant data handling (last 4 digits only)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Secure payment processor ID tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment confirmation date logging"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Audit trail for payment processing"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment Method Support:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Credit/debit card payments with masked PAN"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ACH/bank transfer processing"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Check and wire transfer tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Digital wallet integration (PayPal, Apple Pay, etc.)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reconciliation Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment-to-invoice matching via AR transactions"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment confirmation status tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Processor reference ID management"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Multi-currency payment support"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment reconciliation and matching"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Revenue recognition and cash flow analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client payment history and patterns"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment method performance analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Compliance reporting and audit trails"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1payments/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1payments/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1payments/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/payments","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1payments/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/payments","href":"payments/getpayments","openApiOperationId":"getPayments","summary":"List payments","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1payments/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_30","exampleIds":["paths/~1gql~1v1~1payments/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved payment records","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_67","exampleIds":["paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"schema_67","exampleIds":["paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request - invalid pagination values or an unexpected body property","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1payments/post/responses/400/content/application~1json/examples/unexpected_variable"]}},"schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1payments/post/responses/400/content/application~1json/examples/unexpected_variable"]},{"code":"401","description":"Unauthorized - missing or invalid authentication token","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/401/content/application~1json/examples/missing_auth"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/401/content/application~1json/examples/missing_auth"]},{"code":"403","description":"Forbidden - insufficient permissions for payment data access","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/403/content/application~1json/examples/insufficient_permissions"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/403/content/application~1json/examples/insufficient_permissions"]},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}},"schemaId":"schema_10"}],"pointer":"/paths/~1gql~1v1~1payments/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_67","exampleIds":["paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_67","exampleIds":["paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400","schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1payments/post/responses/400/content/application~1json/examples/unexpected_variable"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_60","exampleIds":["paths/~1gql~1v1~1payments/post/responses/400/content/application~1json/examples/unexpected_variable"]}}},{"code":"401","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/401/content/application~1json/examples/missing_auth"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/401/content/application~1json/examples/missing_auth"]}}},{"code":"403","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/403/content/application~1json/examples/insufficient_permissions"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1payments/post/responses/403/content/application~1json/examples/insufficient_permissions"]}}},{"code":"500","schemaId":"schema_10","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/payments/getpayments"}],"panels":[]}]},"httpPath":"/gql/v1/payments"},{"label":"Search payments","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/payments/filterpaymentsdynamic","routeSlug":"/bundle/payments/filterpaymentsdynamic","metadata":{"seo":{"title":"Search payments","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Payment"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterPaymentsDynamic","name":"Search payments","isWebhook":false,"pointer":"/paths/~1gql~1v1~1payments~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search payments","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/payment"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced payment filtering with a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports text matching, date ranges, and flags."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_68","exampleIds":["paths/~1gql~1v1~1payments~1search/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_68","exampleIds":["paths/~1gql~1v1~1payments~1search/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1gql~1v1~1payments~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/payments/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_68","exampleIds":["paths/~1gql~1v1~1payments~1search/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/payments/search","href":"payments/filterpaymentsdynamic","openApiOperationId":"filterPaymentsDynamic","summary":"Search payments","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_68","exampleIds":["paths/~1gql~1v1~1payments~1search/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_68","exampleIds":["paths/~1gql~1v1~1payments~1search/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved filtered payments","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_69"}},"schemaId":"schema_69"},{"code":"400","description":"Bad request - invalid where/orderBy"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1payments~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_69","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_69"}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/payments/filterpaymentsdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/payments/search"},{"label":"Get payment by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/payments/getpaymentbyid","routeSlug":"/bundle/payments/getpaymentbyid","metadata":{"seo":{"title":"Get payment by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Payment"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getPaymentById","name":"Get payment by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1payment~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get payment by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/payment"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific payment by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint provides detailed payment information including:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Complete payment transaction details"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PCI-compliant payment method information (masked)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment status and confirmation data"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Associated invoice and client relationships"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment processor integration details"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Audit trail and security compliance data"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Security & Compliance:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PCI DSS compliant data handling"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Secure payment processor ID tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment confirmation date logging"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Audit trail for payment processing"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment Details Include:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment amount and currency"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment method (masked for security)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment status and confirmation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Associated invoice references"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client relationship data"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment processor details"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment verification and reconciliation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client payment history lookup"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment dispute resolution"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Audit and compliance reporting"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment method analysis"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" field is an array containing at most one record. An id that"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"matches no payment returns 200 with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"payment\": []"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; the endpoint never"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns 404."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"payment\": [\n    {\n      \"payment_ar_tran_id\": 1048,\n      \"ar_transaction_date\": \"2026-09-01T15:00:34.317714\",\n      \"client_name\": \"Acme Corporation\",\n      \"client_ref\": \"1337\",\n      \"invoice_numbers\": null,\n      \"is_aiwyn_payment\": true,\n      \"is_partial_payment\": false,\n      \"is_payment_success\": true,\n      \"notes\": \"Paid by check\",\n      \"engagement_names\": null,\n      \"paid_by_full_name\": \"Jane Doe\",\n      \"payment_payment_method\": \"Bank Transfer\",\n      \"payment_pp_id\": \"pi_3UAtArIog7gyKVjp2cNQXIBJ\",\n      \"refund_date\": null,\n      \"refund_status\": null,\n      \"staff_admin_id\": true,\n      \"status\": \"Completed\",\n      \"total_bill_amount\": null,\n      \"amount\": 10,\n      \"principal\": 10,\n      \"total_processing_fee_amount\": 0,\n      \"total_international_fee_amount\": 0,\n      \"total_late_fee_amount\": 0,\n      \"is_posted\": false,\n      \"posted_to_bank_dt\": null,\n      \"estimated_deposit_date\": null,\n      \"dispute_status\": null,\n      \"dispute_refund_date\": null,\n      \"total_bill_amount_in_currency\": null,\n      \"amount_in_currency\": null,\n      \"principal_in_currency\": null,\n      \"total_processing_fee_amount_in_currency\": null,\n      \"total_international_fee_amount_in_currency\": null,\n      \"total_late_fee_amount_in_currency\": null,\n      \"currency_code\": null\n    }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"payment\": [\n    {\n      \"payment_ar_tran_id\": 1048,\n      \"ar_transaction_date\": \"2026-09-01T15:00:34.317714\",\n      \"client_name\": \"Acme Corporation\",\n      \"client_ref\": \"1337\",\n      \"invoice_numbers\": null,\n      \"is_aiwyn_payment\": true,\n      \"is_partial_payment\": false,\n      \"is_payment_success\": true,\n      \"notes\": \"Paid by check\",\n      \"engagement_names\": null,\n      \"paid_by_full_name\": \"Jane Doe\",\n      \"payment_payment_method\": \"Bank Transfer\",\n      \"payment_pp_id\": \"pi_3UAtArIog7gyKVjp2cNQXIBJ\",\n      \"refund_date\": null,\n      \"refund_status\": null,\n      \"staff_admin_id\": true,\n      \"status\": \"Completed\",\n      \"total_bill_amount\": null,\n      \"amount\": 10,\n      \"principal\": 10,\n      \"total_processing_fee_amount\": 0,\n      \"total_international_fee_amount\": 0,\n      \"total_late_fee_amount\": 0,\n      \"is_posted\": false,\n      \"posted_to_bank_dt\": null,\n      \"estimated_deposit_date\": null,\n      \"dispute_status\": null,\n      \"dispute_refund_date\": null,\n      \"total_bill_amount_in_currency\": null,\n      \"amount_in_currency\": null,\n      \"principal_in_currency\": null,\n      \"total_processing_fee_amount_in_currency\": null,\n      \"total_international_fee_amount_in_currency\": null,\n      \"total_late_fee_amount_in_currency\": null,\n      \"currency_code\": null\n    }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the payment","required":true,"example":12345}],"pointer":"/paths/~1gql~1v1~1payment~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/payment/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":12345,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/payment/{id}","href":"payments/getpaymentbyid","openApiOperationId":"getPaymentById","summary":"Get payment by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment lookup completed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" holds the matching payment, or is an"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"empty array when no payment has this id."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_70"}},"schemaId":"schema_70"},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_64"}},"schemaId":"schema_64"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this payment"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1payment~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_70","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_70"}}},{"code":"400","schemaId":"schema_64","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_64"}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/payments/getpaymentbyid"}],"panels":[]}]},"httpPath":"/gql/v1/payment/{id}"},{"label":"Create a payment link for a client","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/payments/createclientpaymentlink","routeSlug":"/bundle/payments/createclientpaymentlink","metadata":{"seo":{"title":"Create a payment link for a client","description":"🔐 Required role: PAYLNK_C or API_ADMIN📖 Data dictionary: Payment"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"createClientPaymentLink","name":"Create a payment link for a client","isWebhook":false,"pointer":"/paths/~1api~1v1~1clients~1v1~1link~1payment/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create a payment link for a client","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PAYLNK_C"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/payment"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create a single-use quick payment link that lets a client pay in the Aiwyn payment portal"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The client is resolved by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the same identifier the client carries in the firm's"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"practice management system. Exactly one active client must match."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The link is locked to the arguments given: the payer sees the selected invoices, the amount and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the note prefilled and cannot change them, and the link accepts one payment. Use it to gate a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"deliverable behind a specific invoice. At least one of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"note"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnLabel"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnAutomatically"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expiresInDays"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" must be present; a body carrying only "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", because this route never issues a link to the client's full account. Invoices must"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"belong to the client and must be unpaid; use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/invoices/unpaid"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to list them. The link"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id (the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"qpLink"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" query parameter of the returned URL) is shown only in this response and is never"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"stored: the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" webhook events the payment raises carry its lowercase hex SHA-256 as"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata.paymentLinkPlIdSha256"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the link's id as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata.paymentLinkId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so a payment can be"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"matched to the link that produced it by hashing the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"qpLink"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value. The events no longer carry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata.paymentLinkPlId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" attaches up to 20 key-value pairs of your own to the link, such as the id of the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"return or the order the payment is for. Keys are 1 to 40 letters, digits, underscores or hyphens;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"values are strings of at most 500 printable characters. The payer never sees them. They are echoed"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"back unchanged as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata.paymentLinkMetadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" webhook events the link's"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"payment raises, so you can match the payment to your records without storing the link id. Only"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"your own subscriptions (those of the API user that created the link) receive them; another API user"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"of the firm with a firm-wide Payment subscription gets the event without them. Use identifiers, not"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taxpayer names or other personal data."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A link stays payable for 14 days after it is created. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expiresInDays"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" sets a different lifetime: one of"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"7"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"14"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"30"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"60"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"90"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Any other value is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INVALID_EXPIRY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and no link is created. Create the link with a lifetime that covers the time the payer"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"needs; once it expires, create a new one."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A quick payment link can carry a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". After a successful payment the portal sends the payer back to it (the URL is disclosed only on the charge result, never when the link is opened). The URL must be "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"https"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and its host must be on the firm's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"payment_return_url_allowed_hosts"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" configuration; a firm without that configuration rejects any "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". A link that carries a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" must also name invoices ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") or an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": the portal releases the URL only once the link is paid in full, and a link with neither has no full amount to check, so it is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RETURN_URL_REQUIRES_OBLIGATION"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnLabel"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names that destination on the return button. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnAutomatically: true"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" asks the portal to return on its own after the confirmation, after a short countdown, instead of waiting for the payer to press the button: it navigates to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the link has one, and otherwise closes the payment tab, which it can do only when your system opened that tab by script."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The body is decoded strictly: a key that is not one of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"note"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnLabel"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnAutomatically"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expiresInDays"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" instead"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"of being ignored."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_71","exampleIds":["paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/invoiceLocked","paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/amountOnly"]}},"schemaId":"schema_71","exampleIds":["paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/invoiceLocked","paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/amountOnly"],"pointer":"/paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/clients/v1/link/payment","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_71","exampleIds":["paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/invoiceLocked","paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/amountOnly"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/clients/v1/link/payment","href":"payments/createclientpaymentlink","openApiOperationId":"createClientPaymentLink","summary":"Create a payment link for a client","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_71","exampleIds":["paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/invoiceLocked","paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/amountOnly"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_71","exampleIds":["paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/invoiceLocked","paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/amountOnly"]}},"examples":[{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Client was found and the payment link returned","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_72"}},"schemaId":"schema_72"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"One of five rejections, told apart by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":":"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The body could not be parsed or contains an unknown key. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INVALID_REQUEST_BODY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The body carries no quick payment link argument. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"QUICK_PAYMENT_LINK_ARGUMENTS_REQUIRED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The body carries a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" but neither invoices ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") nor an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Nothing is created. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" starts with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RETURN_URL_REQUIRES_OBLIGATION:"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RETURN_URL_REQUIRES_OBLIGATION"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" matches no client or more than one: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Multiple or no clients found for the reference provided."},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"An embedded argument was rejected: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The invoice, amount or note provided cannot be used to build a payment link for this client."},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Causes: an invoice does not exist, is not open, or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"belongs to another client; more than 100 invoices; an amount with more than two decimal"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"places; a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that is not "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"https"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", whose host is not allow-listed, or sent to a firm"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"with no allow-list; a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnLabel"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" without a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with more than 20 keys, a key outside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the allowed shape, or a value over 500 characters. The exact cause is written to"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn's server log, not to the response, because it can echo caller data. Check the input"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"against "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/invoices/unpaid"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the firm's allow-list."},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_73"}},"schemaId":"schema_73"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"One of two refusals:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The caller lacks the PAYLNK_C or API_ADMIN role."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Quick payment links are not enabled for this firm. Aiwyn enables them per firm; until then"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"every request is refused, nothing is created, and retrying does not help. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" starts"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"QUICK_PAYMENT_LINKS_DISABLED:"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"extensions.details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"QUICK_PAYMENT_LINKS_DISABLED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_74"}},"schemaId":"schema_74"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1clients~1v1~1link~1payment/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_72","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_72"}}},{"code":"400","schemaId":"schema_73","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_73"}}},{"code":"401"},{"code":"403","schemaId":"schema_74","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_74"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/payments/createclientpaymentlink"}],"panels":[]}]},"httpPath":"/api/v1/clients/v1/link/payment"}],"content":{"contentType":"group","meta":{"name":"Payments"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Payments","showPageActions":true},{"nodeType":"markdoc","content":"Handle incoming and outgoing payments."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/payments","summary":"List payments","prefix":{"name":"post","color":"post"},"badges":[],"link":"/payments/getpayments","deprecated":false},{"title":"/gql/v1/payments/search","summary":"Search payments","prefix":{"name":"post","color":"post"},"badges":[],"link":"/payments/filterpaymentsdynamic","deprecated":false},{"title":"/gql/v1/payment/{id}","summary":"Get payment by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/payments/getpaymentbyid","deprecated":false},{"title":"/api/v1/clients/v1/link/payment","summary":"Create a payment link for a client","prefix":{"name":"post","color":"post"},"badges":[],"link":"/payments/createclientpaymentlink","deprecated":false}]}]}]}]}},{"type":"separator","label":"Time management","content":null},{"type":"group","label":"Time management","link":"/bundle/time-management","routeSlug":"/bundle/time-management","items":[{"label":"List all task types","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/gettasktypes","routeSlug":"/bundle/time-management/gettasktypes","metadata":{"seo":{"title":"List all task types","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Task type"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getTaskTypes","name":"List all task types","isWebhook":false,"pointer":"/paths/~1gql~1v1~1task-types/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List all task types","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/task-type"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Task type"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all task types"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns every "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" task type for the tenant, ordered alphabetically by"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"display name. Deactivated task types are not returned; use the search endpoint with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"active\": { \"_eq\": false } }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to list them. Task types classify the work performed on time entries and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projects, and carry billing and tax settings used downstream in invoicing."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each task type includes:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Display name, code, and description"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billing and tax flags ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taxable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Optional custom hourly rate and rate type"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Service line and category associations"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Usage counts across projects and invoices"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn-managed vs firm-defined indicators"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Active status and audit timestamps"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/task-types","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","401","403","500"],"pointer":"/gql/v1/task-types","href":"time-management/gettasktypes","openApiOperationId":"getTaskTypes","summary":"List all task types","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Task types retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_75","exampleIds":["paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/empty"]}},"schemaId":"schema_75","exampleIds":["paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/empty"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires API_ADMIN role)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1task-types/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_75","exampleIds":["paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/empty"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_75","exampleIds":["paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/empty"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/gettasktypes"}],"panels":[]}]},"httpPath":"/gql/v1/task-types"},{"label":"Search task types","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/searchtasktypesdynamic","routeSlug":"/bundle/time-management/searchtasktypesdynamic","metadata":{"seo":{"title":"Search task types","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Task type"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"searchTaskTypesDynamic","name":"Search task types","isWebhook":false,"pointer":"/paths/~1gql~1v1~1task-types~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search task types","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/task-type"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Task type"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced task type filtering with a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports flexible filtering across any task type field using a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clause, with pagination and dynamic ordering."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Deactivated task types (including deactivated "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records) are included, unlike"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /gql/v1/task-types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; filter on "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to choose them: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"active\": { \"_eq\": false } }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns only deactivated task types."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Common filter examples (pass in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" field):"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By code:          "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"code\": { \"_eq\": \"PREP\" } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By active status: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"active\": { \"_eq\": true } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By billable flag: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"billable\": { \"_eq\": true } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By category:      "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"taskTypeCategoryId\": { \"_eq\": 5 } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By service line:  "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"serviceLineId\": { \"_eq\": 2 } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Combined:         "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"_and\": [ { \"billable\": { \"_eq\": true } }, { \"active\": { \"_eq\": true } } ] }"},"children":[],"type":"code"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_76","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/billable_active","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_service_line","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_code"]}},"schemaId":"schema_76","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/billable_active","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_service_line","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_code"],"pointer":"/paths/~1gql~1v1~1task-types~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/task-types/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_76","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/billable_active","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_service_line","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_code"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/task-types/search","href":"time-management/searchtasktypesdynamic","openApiOperationId":"searchTaskTypesDynamic","summary":"Search task types","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_76","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/billable_active","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_service_line","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_code"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_76","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/billable_active","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_service_line","paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_code"]}},"examples":[{},{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Task types retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_77","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/empty"]}},"schemaId":"schema_77","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/empty"]},{"code":"400","description":"Bad request - invalid filter parameters"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires API_ADMIN role)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1task-types~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_77","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/empty"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_77","exampleIds":["paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/empty"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/searchtasktypesdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/task-types/search"},{"label":"Get task by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/findtaskbyid","routeSlug":"/bundle/time-management/findtaskbyid","metadata":{"seo":{"title":"Get task by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Task"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"findTaskById","name":"Get task by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1task~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get task by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/task"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Task"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific task by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns full task details including the associated task type, assignee staff"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"member, and parent job reference."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_78","description":"Unique identifier of the task","required":true,"example":456}],"pointer":"/paths/~1gql~1v1~1task~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/task/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":456,"schemaId":"schema_78"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","401","403","500"],"pointer":"/gql/v1/task/{id}","href":"time-management/findtaskbyid","openApiOperationId":"findTaskById","summary":"Get task by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Task retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_79","exampleIds":["paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_79","exampleIds":["paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires API_ADMIN role)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1task~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_79","exampleIds":["paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_79","exampleIds":["paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/findtaskbyid"}],"panels":[]}]},"httpPath":"/gql/v1/task/{id}"},{"label":"Search tasks","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/searchtasksdynamic","routeSlug":"/bundle/time-management/searchtasksdynamic","metadata":{"seo":{"title":"Search tasks","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Task"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"searchTasksDynamic","name":"Search tasks","isWebhook":false,"pointer":"/paths/~1gql~1v1~1tasks~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search tasks","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/task"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Task"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced task filtering with a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports flexible filtering across any task field — including nested relations"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"such as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — using a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause, with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pagination and dynamic ordering."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Common filter examples (pass in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" field):"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By task type ID:   "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"taskTypeId\": { \"_eq\": 123 } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By task type code: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"taskType\": { \"code\": { \"_eq\": \"PREP\" } } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By client:         "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"job\": { \"clientId\": { \"_eq\": 456 } } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Start date range:  "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"startDate\": { \"_gte\": \"2024-01-01\", \"_lte\": \"2024-12-31\" } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Due date range:    "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"dueDate\": { \"_gte\": \"2024-01-01\", \"_lte\": \"2024-12-31\" } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"By assignee:       "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"assigneeStaffId\": { \"_eq\": 789 } }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Combined:          "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"_and\": [ { \"taskType\": { \"code\": { \"_eq\": \"PREP\" } } }, { \"assigneeStaffId\": { \"_eq\": 789 } } ] }"},"children":[],"type":"code"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_80","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_task_type_and_assignee","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_client","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/due_date_range"]}},"schemaId":"schema_80","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_task_type_and_assignee","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_client","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/due_date_range"],"pointer":"/paths/~1gql~1v1~1tasks~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/tasks/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_80","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_task_type_and_assignee","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_client","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/due_date_range"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/tasks/search","href":"time-management/searchtasksdynamic","openApiOperationId":"searchTasksDynamic","summary":"Search tasks","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_80","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_task_type_and_assignee","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_client","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/due_date_range"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_80","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_task_type_and_assignee","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_client","paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/due_date_range"]}},"examples":[{},{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Tasks retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_81","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/empty"]}},"schemaId":"schema_81","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/empty"]},{"code":"400","description":"Bad request - invalid filter parameters"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires API_ADMIN role)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1tasks~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_81","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/empty"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_81","exampleIds":["paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/empty"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/searchtasksdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/tasks/search"},{"label":"List WIP entries","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/getwip","routeSlug":"/bundle/time-management/getwip","metadata":{"seo":{"title":"List WIP entries","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Work in progress (WIP)"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getWip","name":"List WIP entries","isWebhook":false,"pointer":"/paths/~1gql~1v1~1wip/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List WIP entries","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/wip"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Work in progress (WIP)"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Work in Progress tracking with comprehensive financial lifecycle management"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"<tenant>_vw_wip_unified_aggregate.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response keys are tenant-specific."},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Unlike the other list endpoints, this response is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"not aliased: the records are under "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"<tenant>_vw_wip_unified"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the totals under"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"<tenant>_vw_wip_unified_aggregate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", where "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"<tenant>"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is your tenant's schema name (for"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"acme_vw_wip_unified"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). Read the two keys by suffix rather than by a fixed name."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/wips/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns fixed keys."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This advanced endpoint provides complete WIP management including:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"WIP value tracking from creation through billing completion"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Outstanding balance calculations for unbilled work"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Multi-dimensional analysis (client, job, date-based)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Financial aggregations for WIP reporting and analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration with client data for complete context"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Financial Tracking Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"WIP value recording and outstanding balance calculation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billed amount tracking for revenue recognition"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Write-off amount management for uncollectible WIP"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Job and client correlation for project profitability"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"WIP Lifecycle Management:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creation date logging for aging analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"WIP type categorization (TIME, EXPENSE, FIXED_FEE, etc.)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Outstanding value calculation for billing preparation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billed amount reconciliation for revenue tracking"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Intelligence & Reporting:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client-specific WIP analysis and aging"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Job-based profitability and WIP tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"WIP aging reports for collections management"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Revenue recognition and billing pipeline analysis"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Financial Aggregations:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Total WIP value across filtered records"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Outstanding WIP calculations for billing preparation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billed amount summaries for revenue analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Write-off tracking for financial reporting"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Filtering:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" this endpoint accepts only "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; any other body"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"property is rejected with 400 ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unexpected variable …"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). To filter (by client, job,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"WIP type, logged date, …) or sort, use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/wips/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Active Record Filtering:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Only active WIP records are returned (inactive records represent deletions), newest "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" first"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record includes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"isActive"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" so clients can distinguish active from inactive when querying by ID"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_82","exampleIds":["paths/~1gql~1v1~1wip/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_82","exampleIds":["paths/~1gql~1v1~1wip/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1wip/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/wip","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_82","exampleIds":["paths/~1gql~1v1~1wip/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/wip","href":"time-management/getwip","openApiOperationId":"getWip","summary":"List WIP entries","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_82","exampleIds":["paths/~1gql~1v1~1wip/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_82","exampleIds":["paths/~1gql~1v1~1wip/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved WIP records with financial aggregations","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_83","exampleIds":["paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"schema_83","exampleIds":["paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Bad request. Returned by Hasura for a body property other than "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unexpected variable …"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") or an invalid value (for example a negative "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1wip/post/responses/400/content/application~1json/examples/unexpected_variable"]}},"schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1wip/post/responses/400/content/application~1json/examples/unexpected_variable"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1wip/post/responses/401/content/application~1json/examples/missing_auth"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1wip/post/responses/401/content/application~1json/examples/missing_auth"]},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}},"schemaId":"schema_10"}],"pointer":"/paths/~1gql~1v1~1wip/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_83","exampleIds":["paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_83","exampleIds":["paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/real_api_response","paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400","schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1wip/post/responses/400/content/application~1json/examples/unexpected_variable"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_31","exampleIds":["paths/~1gql~1v1~1wip/post/responses/400/content/application~1json/examples/unexpected_variable"]}}},{"code":"401","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1wip/post/responses/401/content/application~1json/examples/missing_auth"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1wip/post/responses/401/content/application~1json/examples/missing_auth"]}}},{"code":"500","schemaId":"schema_10","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/getwip"}],"panels":[]}]},"httpPath":"/gql/v1/wip"},{"label":"Search WIP entries","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/filterwipsdynamic","routeSlug":"/bundle/time-management/filterwipsdynamic","metadata":{"seo":{"title":"Search WIP entries","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Work in progress (WIP)"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterWipsDynamic","name":"Search WIP entries","isWebhook":false,"pointer":"/paths/~1gql~1v1~1wips~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search WIP entries","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/wip"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Work in progress (WIP)"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced WIP filtering with a flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports wipType selection, date ranges, and client/job constraints."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Without a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", only active WIP records are returned (the default is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"isActive\": { \"_eq\": true } }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). A "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" replaces that default, so add"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"isActive"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to it to keep excluding inactive records. Default order is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate desc, createdAt desc"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_84","exampleIds":["paths/~1gql~1v1~1wips~1search/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_84","exampleIds":["paths/~1gql~1v1~1wips~1search/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1gql~1v1~1wips~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/wips/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_84","exampleIds":["paths/~1gql~1v1~1wips~1search/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/wips/search","href":"time-management/filterwipsdynamic","openApiOperationId":"filterWipsDynamic","summary":"Search WIP entries","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_84","exampleIds":["paths/~1gql~1v1~1wips~1search/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_84","exampleIds":["paths/~1gql~1v1~1wips~1search/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved filtered WIP entries","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_85","exampleIds":["paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/empty"]}},"schemaId":"schema_85","exampleIds":["paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/empty"]},{"code":"400","description":"Bad request - invalid where/orderBy (for example a field that does not exist on the WIP view)","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_86"}},"schemaId":"schema_86"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1wips~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_85","exampleIds":["paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/empty"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_85","exampleIds":["paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/empty"]}}},{"code":"400","schemaId":"schema_86","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_86"}}},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/filterwipsdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/wips/search"},{"label":"Get WIP entry by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/getwipbyid","routeSlug":"/bundle/time-management/getwipbyid","metadata":{"seo":{"title":"Get WIP entry by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Work in progress (WIP)"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getWipById","name":"Get WIP entry by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1time~1wip~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get WIP entry by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/wip"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Work in progress (WIP)"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a specific work-in-progress (WIP) record by its unique identifier"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the WIP record with the same fields as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/wip"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", including"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"inactive records (check "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"isActive"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; inactive records represent deletions)."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The record is wrapped in a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"wip"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" array that holds at most one element; an id"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"that does not exist returns 200 with an empty array."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the WIP record","required":true,"example":89012}],"pointer":"/paths/~1gql~1v1~1time~1wip~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/time/wip/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":89012,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/time/wip/{id}","href":"time-management/getwipbyid","openApiOperationId":"getWipById","summary":"Get WIP entry by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The WIP record, wrapped in a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"wip"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" array with at most one element."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"An id that does not exist returns an empty array."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_87","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_87","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}},"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this WIP record"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1time~1wip~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_87","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_87","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/success","paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_34","exampleIds":["paths/~1gql~1v1~1time~1wip~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/getwipbyid"}],"panels":[]}]},"httpPath":"/gql/v1/time/wip/{id}"},{"label":"List available time management code record types","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/listtimemanagementcodetypes","routeSlug":"/bundle/time-management/listtimemanagementcodetypes","metadata":{"seo":{"title":"List available time management code record types","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"listTimeManagementCodeTypes","name":"List available time management code record types","isWebhook":false,"pointer":"/paths/~1api~1v1~1codes~1types/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List available time management code record types","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"List available time management code record types"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the code types that can be managed via the Product API under "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/api/v1/codes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":":"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/codes/types","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/codes/types","href":"time-management/listtimemanagementcodetypes","openApiOperationId":"listTimeManagementCodeTypes","summary":"List available time management code record types","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Code types retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_88"}},"schemaId":"schema_88"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1codes~1types/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_88","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_88"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/listtimemanagementcodetypes"}],"panels":[]}]},"httpPath":"/api/v1/codes/types"},{"label":"Get field schema for a time management code type","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/gettimemanagementcodeschema","routeSlug":"/bundle/time-management/gettimemanagementcodeschema","metadata":{"seo":{"title":"Get field schema for a time management code type","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getTimeManagementCodeSchema","name":"Get field schema for a time management code type","isWebhook":false,"pointer":"/paths/~1api~1v1~1codes~1schema~1{type}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get field schema for a time management code type","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get field schema for a time management code type"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns field definitions for the requested code type."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"For "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"display"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are required; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" defaults to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"description"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taxable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reimbursable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are optional."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/codes/schema/ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for the full attribute list."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"type","in":"path","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Code type, as listed by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/codes/types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1codes~1schema~1{type}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/codes/schema/{type}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"type","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/codes/schema/{type}","href":"time-management/gettimemanagementcodeschema","openApiOperationId":"getTimeManagementCodeSchema","summary":"Get field schema for a time management code type","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Schema retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_89"}},"schemaId":"schema_89"},{"code":"400","description":"Invalid code type"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1codes~1schema~1{type}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_89","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_89"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/gettimemanagementcodeschema"}],"panels":[]}]},"httpPath":"/api/v1/codes/schema/{type}"},{"label":"Create or update time management code records (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/upserttimemanagementcodes","routeSlug":"/bundle/time-management/upserttimemanagementcodes","metadata":{"seo":{"title":"Create or update time management code records (upsert)","description":"🔐 Required role: TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertTimeManagementCodes","name":"Create or update time management code records (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1codes/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update time management code records (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update time management code records (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records are created if they don't exist, or updated if matched by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"A type that is not a code type returns 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagementcodes/request/expensecode","deepLinkHash":"/time-management/upserttimemanagementcodes#time-management/upserttimemanagementcodes/request/expensecode"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Expense codes classify "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records. Persist them here first, then reference"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"them from entries by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (the exact "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value) or by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". See the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" request sample."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1codes/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1codes/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1codes/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/codes","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1codes/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/codes","href":"time-management/upserttimemanagementcodes","openApiOperationId":"upsertTimeManagementCodes","summary":"Create or update time management code records (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1codes/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1codes/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All codes processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some code records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every code record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1codes/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/upserttimemanagementcodes"}],"panels":[]}]},"httpPath":"/api/v1/codes"},{"label":"Lookup time management code records in pages (by type)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/pagedlookuptimemanagementcodes","routeSlug":"/bundle/time-management/pagedlookuptimemanagementcodes","metadata":{"seo":{"title":"Lookup time management code records in pages (by type)","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupTimeManagementCodes","name":"Lookup time management code records in pages (by type)","isWebhook":false,"pointer":"/paths/~1api~1v1~1codes~1batch~1{type}/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup time management code records in pages (by type)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup time management code records in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"{type}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is any code type from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/codes/types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/api/v1/codes/batch/ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"type","in":"path","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Code type, as listed by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/codes/types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1codes~1batch~1{type}/post/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1codes~1batch~1{type}/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/codes/batch/{type}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"type","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/codes/batch/{type}","href":"time-management/pagedlookuptimemanagementcodes","openApiOperationId":"pagedLookupTimeManagementCodes","summary":"Lookup time management code records in pages (by type)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1codes~1batch~1{type}/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/pagedlookuptimemanagementcodes"}],"panels":[]}]},"httpPath":"/api/v1/codes/batch/{type}"},{"label":"List available time management entry record types","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/listtimemanagemententrytypes","routeSlug":"/bundle/time-management/listtimemanagemententrytypes","metadata":{"seo":{"title":"List available time management entry record types","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"listTimeManagementEntryTypes","name":"List available time management entry record types","isWebhook":false,"pointer":"/paths/~1api~1v1~1entries~1types/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List available time management entry record types","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"List available time management entry record types"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the entry types that can be managed via the Product API under "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/api/v1/entries"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":":"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Expense entries share the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"upsert, schema, and lookup endpoints with time entries."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/entries/types","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/entries/types","href":"time-management/listtimemanagemententrytypes","openApiOperationId":"listTimeManagementEntryTypes","summary":"List available time management entry record types","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Entry types retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_88"}},"schemaId":"schema_88"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1entries~1types/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_88","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_88"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/listtimemanagemententrytypes"}],"panels":[]}]},"httpPath":"/api/v1/entries/types"},{"label":"Get field schema for a time management entry type","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/gettimemanagemententryschema","routeSlug":"/bundle/time-management/gettimemanagemententryschema","metadata":{"seo":{"title":"Get field schema for a time management entry type","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getTimeManagementEntrySchema","name":"Get field schema for a time management entry type","isWebhook":false,"pointer":"/paths/~1api~1v1~1entries~1schema~1{type}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get field schema for a time management entry type","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get field schema for a time management entry type"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns field definitions for the requested entry type."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"For "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the schema includes optional "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (FK to Task) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(work code string). Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to see the full"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attribute list for your tenant, including custom fields."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"For "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the schema includes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (FK to ExpenseCode), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and the optional "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (expense code string). Use"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for the full attribute list."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"type","in":"path","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entry type, as listed by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1entries~1schema~1{type}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/entries/schema/{type}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"type","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/entries/schema/{type}","href":"time-management/gettimemanagemententryschema","openApiOperationId":"getTimeManagementEntrySchema","summary":"Get field schema for a time management entry type","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Schema retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_89"}},"schemaId":"schema_89"},{"code":"400","description":"Invalid entry type"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1entries~1schema~1{type}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_89","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_89"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/gettimemanagemententryschema"}],"panels":[]}]},"httpPath":"/api/v1/entries/schema/{type}"},{"label":"Create or update time management entry records (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/upserttimemanagemententries","routeSlug":"/bundle/time-management/upserttimemanagemententries","metadata":{"seo":{"title":"Create or update time management entry records (upsert)","description":"🔐 Required role: TM_ENTRY_C📖 Data dictionary: Time entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertTimeManagementEntries","name":"Create or update time management entry records (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1entries/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update time management entry records (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update time management entry records (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records are created if they don't exist, or updated if matched by top-level "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"A type that is not an entry type returns 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagemententries/request/timeentry-hours-rate-and-amounts","deepLinkHash":"/time-management/upserttimemanagemententries#time-management/upserttimemanagemententries/request/timeentry-hours-rate-and-amounts"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry — hours, rate and amounts"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"hours"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" worked. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount in currency"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", not the hours."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Omit "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when your system does not know the firm's billing rates (a time-entry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tool, for example). Aiwyn then resolves the rate card rate for the logged staff, the work code"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and the logged date exactly as the firm portal does, and computes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". The entry also gets an audit transaction. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is still"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"required by the schema: send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it is overwritten."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" only when your system is the source of truth for rates (a practice"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"management system). The record is then stored exactly as sent, nothing is computed."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A billable work code with no active rate card rate for that staff type and date fails the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"record with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RATE_NOT_FOUND"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Set the rate card up in Aiwyn first."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Re-posting an entry (same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") without "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" resolves the rate again from the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"values sent, as an edit in the firm portal does. An entry already on an invoice is locked and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fails the record with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"LOCKED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"Time\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are required by the schema."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for the three amounts on a new entry. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an ISO-8601 date-time with zone"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"2026-06-17T09:00:00Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"posted"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"approved"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" default to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": an entry posted by an external system is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"treated as already approved and posted. Send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" explicitly if the firm reviews"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entries in Aiwyn before billing."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagemententries/request/timeentry-identifying-the-work-(task-type)","deepLinkHash":"/time-management/upserttimemanagemententries#time-management/upserttimemanagemententries/request/timeentry-identifying-the-work-(task-type)"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry — identifying the work (task type)"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The work code decides whether the entry is billable and which rate applies. Send one of:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — the work code string. It must match the exact "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"time_management_entry_code.code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value, or fall back to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_type.code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Stored as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entry_code_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — a project task. Accepts a systemRef ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"system\": \"PM\", \"reference\": \"<task-pmsRef>\" }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"),"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a numeric Aiwyn id, or a string numeric id (treated as Aiwyn id). The work code is derived"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"from the task's task type when no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is supplied. When both are provided, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" wins."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"An entry with neither is stored as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"non-billable with a zero amount"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", because no rate"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"can be resolved without a work code."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagemententries/request/resolving-task-references","deepLinkHash":"/time-management/upserttimemanagemententries#time-management/upserttimemanagemententries/request/resolving-task-references"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Resolving task references"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Look up tasks before upserting entries:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /gql/v1/task/{id}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — get a task by Aiwyn id"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/tasks/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — search tasks (filter by job, assignee, task type, dates)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"See "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for the full attribute list, including custom fields."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagemententries/request/example-time-entry-tool-(rate-resolved-by-aiwyn)","deepLinkHash":"/time-management/upserttimemanagemententries#time-management/upserttimemanagemententries/request/example-time-entry-tool-(rate-resolved-by-aiwyn)"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example — time-entry tool (rate resolved by Aiwyn)"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"See the request sample: hours in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 0,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the work code in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagemententries/request/example-practice-management-system-(rate-already-resolved)","deepLinkHash":"/time-management/upserttimemanagemententries#time-management/upserttimemanagemententries/request/example-practice-management-system-(rate-already-resolved)"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example — practice management system (rate already resolved)"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"records\": [\n    {\n      \"type\": \"TimeEntry\",\n      \"systemRef\": {\"system\": \"PM\", \"reference\": \"pms-entry-002\"},\n      \"attributes\": {\n        \"pmsRef\": \"pms-entry-002\",\n        \"type\": \"Time\",\n        \"loggedDate\": \"2026-06-17T14:00:00Z\",\n        \"units\": 1.0,\n        \"billedPerUnit\": 250,\n        \"value\": 250,\n        \"costPerUnit\": 90,\n        \"billedAmount\": 0,\n        \"writeOffAmount\": 0,\n        \"billable\": true,\n        \"clientId\": {\"system\": \"PM\", \"reference\": \"37584\"},\n        \"jobId\": {\"system\": \"PM\", \"reference\": \"AIWYN_29059\"},\n        \"loggedStaffId\": {\"system\": \"PM\", \"reference\": \"12345\"},\n        \"taskId\": {\"system\": \"PM\", \"reference\": \"AIWYN_98765\"}\n      }\n    }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"records\": [\n    {\n      \"type\": \"TimeEntry\",\n      \"systemRef\": {\"system\": \"PM\", \"reference\": \"pms-entry-002\"},\n      \"attributes\": {\n        \"pmsRef\": \"pms-entry-002\",\n        \"type\": \"Time\",\n        \"loggedDate\": \"2026-06-17T14:00:00Z\",\n        \"units\": 1.0,\n        \"billedPerUnit\": 250,\n        \"value\": 250,\n        \"costPerUnit\": 90,\n        \"billedAmount\": 0,\n        \"writeOffAmount\": 0,\n        \"billable\": true,\n        \"clientId\": {\"system\": \"PM\", \"reference\": \"37584\"},\n        \"jobId\": {\"system\": \"PM\", \"reference\": \"AIWYN_29059\"},\n        \"loggedStaffId\": {\"system\": \"PM\", \"reference\": \"12345\"},\n        \"taskId\": {\"system\": \"PM\", \"reference\": \"AIWYN_98765\"}\n      }\n    }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagemententries/request/recording-an-expense-with-expenseentry","deepLinkHash":"/time-management/upserttimemanagemententries#time-management/upserttimemanagemententries/request/recording-an-expense-with-expenseentry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Recording an expense with ExpenseEntry"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is WIP-backed like "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": it carries "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and the same checks apply (inactive client, inactive project,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client/project mismatch, inactive staff). An entry already on an invoice is locked and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fails the record with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"LOCKED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". No rate is resolved for an expense: it is stored as sent."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"Expense\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are required by the schema. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expense amount. Send what the firm portal stores for an expense: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 1, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" equal to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"posted"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"approved"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" default to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": an expense posted by an external system is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"treated as already approved and posted. Send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" explicitly if the firm reviews"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenses in Aiwyn before billing, as it does for expenses entered in the firm portal."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"notes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the entry description carried on the WIP; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the firm-internal note."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Select the expense code with either attribute:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": the numeric Aiwyn id of an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". A non-null "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" wins"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"when both are supplied."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": the exact "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value of an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; when several codes share the value,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"an active one is preferred. An unknown code fails the record with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unknown ExpenseEntry code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; persist codes first via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/codes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"See "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for the full attribute list, including custom"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fields, and the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" request example at the end of this page."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"level":3,"id":"time-management/upserttimemanagemententries/request/migrating-from-the-firm-portal-expense-form","deepLinkHash":"/time-management/upserttimemanagemententries#time-management/upserttimemanagemententries/request/migrating-from-the-firm-portal-expense-form"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Migrating from the firm portal expense form"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Firm portal field"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" attribute"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"same name; numeric Aiwyn id or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"system\": \"PM\", \"reference\": \"<pmsRef>\"}"},"children":[],"type":"code"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"notes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"same name; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an ISO-8601 date-time with offset, e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"2026-06-17T00:00:00Z"},"children":[],"type":"code"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"not on the form"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"Expense\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (the form copies it from the expense code); "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"posted"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"approved"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to match a form submission"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"wipId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"not sent; records are matched by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Sync time entries from external time-tracking systems"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Sync expense entries from expense-management and reimbursement systems"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attach project tasks to time entries"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Upsert entries by external system reference"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry with expense code:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"records\": [\n    {\n      \"type\": \"ExpenseEntry\",\n      \"systemRef\": {\"system\": \"PM\", \"reference\": \"beeye-expense-001\"},\n      \"attributes\": {\n        \"pmsRef\": \"beeye-expense-001\",\n        \"type\": \"Expense\",\n        \"loggedDate\": \"2026-06-17T00:00:00Z\",\n        \"value\": 123.45,\n        \"units\": 1,\n        \"costPerUnit\": 123.45,\n        \"billedPerUnit\": 123.45,\n        \"billedAmount\": 0,\n        \"writeOffAmount\": 0,\n        \"billable\": true,\n        \"notes\": \"Client site travel\",\n        \"internalNotes\": \"Mileage, 150 mi\",\n        \"clientId\": {\"system\": \"PM\", \"reference\": \"37584\"},\n        \"jobId\": {\"system\": \"PM\", \"reference\": \"AIWYN_29059\"},\n        \"loggedStaffId\": {\"system\": \"PM\", \"reference\": \"12345\"},\n        \"code\": \"TRAVEL\"\n      }\n    }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"records\": [\n    {\n      \"type\": \"ExpenseEntry\",\n      \"systemRef\": {\"system\": \"PM\", \"reference\": \"beeye-expense-001\"},\n      \"attributes\": {\n        \"pmsRef\": \"beeye-expense-001\",\n        \"type\": \"Expense\",\n        \"loggedDate\": \"2026-06-17T00:00:00Z\",\n        \"value\": 123.45,\n        \"units\": 1,\n        \"costPerUnit\": 123.45,\n        \"billedPerUnit\": 123.45,\n        \"billedAmount\": 0,\n        \"writeOffAmount\": 0,\n        \"billable\": true,\n        \"notes\": \"Client site travel\",\n        \"internalNotes\": \"Mileage, 150 mi\",\n        \"clientId\": {\"system\": \"PM\", \"reference\": \"37584\"},\n        \"jobId\": {\"system\": \"PM\", \"reference\": \"AIWYN_29059\"},\n        \"loggedStaffId\": {\"system\": \"PM\", \"reference\": \"12345\"},\n        \"code\": \"TRAVEL\"\n      }\n    }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1entries/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1entries/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1entries/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/entries","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1entries/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/entries","href":"time-management/upserttimemanagemententries","openApiOperationId":"upsertTimeManagementEntries","summary":"Create or update time management entry records (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1entries/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1entries/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All entries processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some entry records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every entry record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1entries/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/upserttimemanagemententries"}],"panels":[]}]},"httpPath":"/api/v1/entries"},{"label":"Lookup time management entry records in pages (by type)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time-management/pagedlookuptimemanagemententries","routeSlug":"/bundle/time-management/pagedlookuptimemanagemententries","metadata":{"seo":{"title":"Lookup time management entry records in pages (by type)","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupTimeManagementEntries","name":"Lookup time management entry records in pages (by type)","isWebhook":false,"pointer":"/paths/~1api~1v1~1entries~1batch~1{type}/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup time management entry records in pages (by type)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup time management entry records in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"{type}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is any entry type from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/api/v1/entries/batch/ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"type","in":"path","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entry type, as listed by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1entries~1batch~1{type}/post/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1entries~1batch~1{type}/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/entries/batch/{type}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"type","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/entries/batch/{type}","href":"time-management/pagedlookuptimemanagemententries","openApiOperationId":"pagedLookupTimeManagementEntries","summary":"Lookup time management entry records in pages (by type)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1entries~1batch~1{type}/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time-management/pagedlookuptimemanagemententries"}],"panels":[]}]},"httpPath":"/api/v1/entries/batch/{type}"}],"content":{"contentType":"group","meta":{"name":"Time Management"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Time management","showPageActions":true},{"nodeType":"markdoc","content":"Track and manage time, expense, operational, and PTO entries, and the codes they are logged against."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/task-types","summary":"List all task types","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time-management/gettasktypes","deprecated":false},{"title":"/gql/v1/task-types/search","summary":"Search task types","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/searchtasktypesdynamic","deprecated":false},{"title":"/gql/v1/task/{id}","summary":"Get task by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time-management/findtaskbyid","deprecated":false},{"title":"/gql/v1/tasks/search","summary":"Search tasks","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/searchtasksdynamic","deprecated":false},{"title":"/gql/v1/wip","summary":"List WIP entries","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/getwip","deprecated":false},{"title":"/gql/v1/wips/search","summary":"Search WIP entries","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/filterwipsdynamic","deprecated":false},{"title":"/gql/v1/time/wip/{id}","summary":"Get WIP entry by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time-management/getwipbyid","deprecated":false},{"title":"/api/v1/codes/types","summary":"List available time management code record types","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time-management/listtimemanagementcodetypes","deprecated":false},{"title":"/api/v1/codes/schema/{type}","summary":"Get field schema for a time management code type","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time-management/gettimemanagementcodeschema","deprecated":false},{"title":"/api/v1/codes","summary":"Create or update time management code records (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/upserttimemanagementcodes","deprecated":false},{"title":"/api/v1/codes/batch/{type}","summary":"Lookup time management code records in pages (by type)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/pagedlookuptimemanagementcodes","deprecated":false},{"title":"/api/v1/entries/types","summary":"List available time management entry record types","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time-management/listtimemanagemententrytypes","deprecated":false},{"title":"/api/v1/entries/schema/{type}","summary":"Get field schema for a time management entry type","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time-management/gettimemanagemententryschema","deprecated":false},{"title":"/api/v1/entries","summary":"Create or update time management entry records (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/upserttimemanagemententries","deprecated":false},{"title":"/api/v1/entries/batch/{type}","summary":"Lookup time management entry records in pages (by type)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time-management/pagedlookuptimemanagemententries","deprecated":false}]}]}]}]}},{"type":"group","label":"Time","link":"/bundle/time","routeSlug":"/bundle/time","items":[{"label":"Create or update time codes (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time/upserttimecodes","routeSlug":"/bundle/time/upserttimecodes","metadata":{"seo":{"title":"Create or update time codes (upsert)","description":"🔐 Required role: TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertTimeCodes","name":"Create or update time codes (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1time-codes/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update time codes (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update time codes (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time codes are the task types that time entries are logged against."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the code its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the code with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"that Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"new code is created. Attributes left out of an update keep their values. A record with any field"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"other than "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time codes kept as task types appear in the lookup but aren't matched here, so sending one"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"creates a new time code."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.reference"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Code value that time entries reference."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"display"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Name shown in Aiwyn."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"description"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Longer description."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether time logged against the code is billable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"taxable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether time logged against the code is taxable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"reimbursable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether costs logged against the code are reimbursable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the code."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the rate type used to price time on this code."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"customHourlyRate"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Hourly rate that overrides the rate type."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskTypeCategoryId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the task type category."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"serviceLineId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the service line."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A new time code needs "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". The paged lookup and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/time-codes/{id}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" return "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reimbursable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and for time codes created here they"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"don't return "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"customHourlyRate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskTypeCategoryId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"serviceLineId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; the values you"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send are kept. A deactivated time code is no longer returned by either."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-codes/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-codes/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1time-codes/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/time-codes","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-codes/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/time-codes","href":"time/upserttimecodes","openApiOperationId":"upsertTimeCodes","summary":"Create or update time codes (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-codes/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-codes/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All time codes processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1time-codes/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time/upserttimecodes"}],"panels":[]}]},"httpPath":"/api/v1/time-codes"},{"label":"Lookup time codes in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time/pagedlookuptimecodes","routeSlug":"/bundle/time/pagedlookuptimecodes","metadata":{"seo":{"title":"Lookup time codes in pages","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupTimeCodes","name":"Lookup time codes in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1time-codes~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup time codes in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup time codes in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of active "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1time-codes~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/time-codes/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/time-codes/batch","href":"time/pagedlookuptimecodes","openApiOperationId":"pagedLookupTimeCodes","summary":"Lookup time codes in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1time-codes~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time/pagedlookuptimecodes"}],"panels":[]}]},"httpPath":"/api/v1/time-codes/batch"},{"label":"Get a time code by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time/gettimecodebyid","routeSlug":"/bundle/time/gettimecodebyid","metadata":{"seo":{"title":"Get a time code by Aiwyn ID","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getTimeCodeById","name":"Get a time code by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1time-codes~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get a time code by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get a time code by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Only active time codes are returned, as in the paged lookup."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the code, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1time-codes~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/time-codes/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/time-codes/{id}","href":"time/gettimecodebyid","openApiOperationId":"getTimeCodeById","summary":"Get a time code by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Time code retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No time code has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1time-codes~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time/gettimecodebyid"}],"panels":[]}]},"httpPath":"/api/v1/time-codes/{id}"},{"label":"Create or update time entries (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time/upserttimeentries","routeSlug":"/bundle/time/upserttimeentries","metadata":{"seo":{"title":"Create or update time entries (upsert)","description":"🔐 Required role: TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertTimeEntries","name":"Create or update time entries (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1time-entries/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update time entries (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update time entries (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is always"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" sent in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is replaced. Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the entry its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the entry with that"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a new entry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"is created. Attributes left out of an update keep their values. A record with any field other than"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"see below"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"date-time"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When the work was done; see below."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member who did the work."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client the work was for."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project task; sets the work code."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Work code: a time code "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (active preferred), else a task type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"see below"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Hours worked. Always send it; see below."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Amount in currency; see below."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"see below"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billing rate."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cost rate; see below."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Amount already billed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a new entry."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Amount written off. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a new entry."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"see below"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the work is billable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"posted"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the entry is posted."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"approved"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the entry is approved."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"notes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entry description."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note for your firm."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"onCalendar"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the entry shows on the staff calendar."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the entry."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Without "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", a new entry takes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PM"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and a generated"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference otherwise. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an ISO-8601 date-time with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or an offset, for example"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"2026-06-17T00:00:00Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; an offset is converted to UTC. A date alone, or a date-time without "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or an"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"offset, fails with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"VALIDATION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How rates are set depends on whether rate resolution is enabled for your firm (ask Aiwyn support)."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"With rate resolution enabled, leave "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" out when your system does not know the firm's billing"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rates (a time-entry tool). Aiwyn rounds the hours to the firm's increment, takes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" from the work"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code when you don't send it ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" without a work code), resolves the rate card rate and average cost for"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the staff member, the work code and the date, and computes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; send"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Always send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": without it, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is read as the hours. An update"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"without "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is priced again from the entry as it stands after the update, with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" taken"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"from the work code unless the update sends it. That includes a submitted entry, whose rate the firm portal"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"keeps on edit. Send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when your system owns the rates (a practice management system); the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entry is then stored as sent."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Without rate resolution, every entry is stored as sent: send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" defaults to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the work code as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (a time code, else a task type with that code) or as a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose task type"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"is the work code; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" wins when both are sent. With rate resolution enabled, an entry with neither and no"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is non-billable."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record fails with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_CLIENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_PROJECT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_RESOURCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the client, project or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff member is inactive, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"REFERENCE_MISMATCH"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the project belongs to another client, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"LOCKED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entry is already on an invoice, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CONVERSION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for an unknown "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNRESOLVED_REFERENCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" matches no staff member, client, project or task (an Aiwyn ID is stored as sent,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"without a check), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"BUILD_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a required attribute is missing, and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"VALIDATION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a negative"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", a blank "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or an invalid"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". With rate resolution enabled, it also fails with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RATE_NOT_FOUND"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when no rate card rate or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"average cost exists for the staff type and date, when the staff member has no staff type, or when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a billable time code with no task type of that code, and with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"WORK_CODE_SERVICE_LINE_MISMATCH"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"work code does not belong to the project's service line."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom fields your firm defines for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are accepted too; list them with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none succeeded —"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry with rates (rate resolution off, or rates owned by your system):"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"records\": [\n    {\n      \"systemRef\": {\"system\": \"PM\", \"reference\": \"entry-002\"},\n      \"attributes\": {\n        \"loggedDate\": \"2026-06-17T00:00:00Z\",\n        \"loggedStaffId\": {\"system\": \"PM\", \"reference\": \"12345\"},\n        \"clientId\": {\"system\": \"PM\", \"reference\": \"37584\"},\n        \"jobId\": {\"system\": \"PM\", \"reference\": \"AIWYN_29059\"},\n        \"code\": \"TXBLE30X01\",\n        \"units\": 2.5,\n        \"value\": 375.00,\n        \"billedPerUnit\": 150.00,\n        \"costPerUnit\": 60.00,\n        \"billedAmount\": 0,\n        \"writeOffAmount\": 0,\n        \"billable\": true,\n        \"notes\": \"Tax planning deliverable\"\n      }\n    }\n  ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"records\": [\n    {\n      \"systemRef\": {\"system\": \"PM\", \"reference\": \"entry-002\"},\n      \"attributes\": {\n        \"loggedDate\": \"2026-06-17T00:00:00Z\",\n        \"loggedStaffId\": {\"system\": \"PM\", \"reference\": \"12345\"},\n        \"clientId\": {\"system\": \"PM\", \"reference\": \"37584\"},\n        \"jobId\": {\"system\": \"PM\", \"reference\": \"AIWYN_29059\"},\n        \"code\": \"TXBLE30X01\",\n        \"units\": 2.5,\n        \"value\": 375.00,\n        \"billedPerUnit\": 150.00,\n        \"costPerUnit\": 60.00,\n        \"billedAmount\": 0,\n        \"writeOffAmount\": 0,\n        \"billable\": true,\n        \"notes\": \"Tax planning deliverable\"\n      }\n    }\n  ]\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-entries/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-entries/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1time-entries/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/time-entries","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-entries/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/time-entries","href":"time/upserttimeentries","openApiOperationId":"upsertTimeEntries","summary":"Create or update time entries (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-entries/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1time-entries/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All time entries processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1time-entries/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time/upserttimeentries"}],"panels":[]}]},"httpPath":"/api/v1/time-entries"},{"label":"Lookup time entries in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time/pagedlookuptimeentries","routeSlug":"/bundle/time/pagedlookuptimeentries","metadata":{"seo":{"title":"Lookup time entries in pages","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupTimeEntries","name":"Lookup time entries in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1time-entries~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup time entries in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup time entries in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of active "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records; a deactivated entry is not listed."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1time-entries~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/time-entries/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/time-entries/batch","href":"time/pagedlookuptimeentries","openApiOperationId":"pagedLookupTimeEntries","summary":"Lookup time entries in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1time-entries~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time/pagedlookuptimeentries"}],"panels":[]}]},"httpPath":"/api/v1/time-entries/batch"},{"label":"Get a time entry by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/time/gettimeentrybyid","routeSlug":"/bundle/time/gettimeentrybyid","metadata":{"seo":{"title":"Get a time entry by Aiwyn ID","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getTimeEntryById","name":"Get a time entry by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1time-entries~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get a time entry by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get a time entry by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup. Only"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active entries are returned, as in the paged lookup. An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the entry, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1time-entries~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/time-entries/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/time-entries/{id}","href":"time/gettimeentrybyid","openApiOperationId":"getTimeEntryById","summary":"Get a time entry by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Time entry retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No time entry has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1time-entries~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/time/gettimeentrybyid"}],"panels":[]}]},"httpPath":"/api/v1/time-entries/{id}"}],"content":{"contentType":"group","meta":{"name":"Time"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Time","showPageActions":true},{"nodeType":"markdoc","content":"Create, update and look up time codes, the task types that time entries are logged against, and time\nentries, the hours staff work for clients."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v1/time-codes","summary":"Create or update time codes (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time/upserttimecodes","deprecated":false},{"title":"/api/v1/time-codes/batch","summary":"Lookup time codes in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time/pagedlookuptimecodes","deprecated":false},{"title":"/api/v1/time-codes/{id}","summary":"Get a time code by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time/gettimecodebyid","deprecated":false},{"title":"/api/v1/time-entries","summary":"Create or update time entries (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time/upserttimeentries","deprecated":false},{"title":"/api/v1/time-entries/batch","summary":"Lookup time entries in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/time/pagedlookuptimeentries","deprecated":false},{"title":"/api/v1/time-entries/{id}","summary":"Get a time entry by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/time/gettimeentrybyid","deprecated":false}]}]}]}]}},{"type":"group","label":"Expenses","link":"/bundle/expenses","routeSlug":"/bundle/expenses","items":[{"label":"Create or update expense codes (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/expenses/upsertexpensecodes","routeSlug":"/bundle/expenses/upsertexpensecodes","metadata":{"seo":{"title":"Create or update expense codes (upsert)","description":"🔐 Required role: TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertExpenseCodes","name":"Create or update expense codes (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1expense-codes/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update expense codes (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update expense codes (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Expense codes classify expense entries; an entry references one by its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the code its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the code with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"that Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"new code is created. Attributes left out of an update keep their values. A record with any field"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"other than "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Some older expense codes appear in the lookup but aren't matched here, so sending one creates a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"new expense code."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"see below"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Code value that expense entries reference."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"display"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Name shown in Aiwyn."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"description"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Longer description."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether expenses on the code are billable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"taxable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether expenses on the code are taxable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"reimbursable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether expenses on the code are reimbursable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the code."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Without "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", a new code takes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PM"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"generated reference otherwise."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-codes/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-codes/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1expense-codes/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/expense-codes","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-codes/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/expense-codes","href":"expenses/upsertexpensecodes","openApiOperationId":"upsertExpenseCodes","summary":"Create or update expense codes (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-codes/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-codes/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All expense codes processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1expense-codes/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/expenses/upsertexpensecodes"}],"panels":[]}]},"httpPath":"/api/v1/expense-codes"},{"label":"Lookup expense codes in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/expenses/pagedlookupexpensecodes","routeSlug":"/bundle/expenses/pagedlookupexpensecodes","metadata":{"seo":{"title":"Lookup expense codes in pages","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupExpenseCodes","name":"Lookup expense codes in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1expense-codes~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup expense codes in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup expense codes in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1expense-codes~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/expense-codes/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/expense-codes/batch","href":"expenses/pagedlookupexpensecodes","openApiOperationId":"pagedLookupExpenseCodes","summary":"Lookup expense codes in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1expense-codes~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/expenses/pagedlookupexpensecodes"}],"panels":[]}]},"httpPath":"/api/v1/expense-codes/batch"},{"label":"Get an expense code by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/expenses/getexpensecodebyid","routeSlug":"/bundle/expenses/getexpensecodebyid","metadata":{"seo":{"title":"Get an expense code by Aiwyn ID","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getExpenseCodeById","name":"Get an expense code by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1expense-codes~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get an expense code by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get an expense code by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the code, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1expense-codes~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/expense-codes/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/expense-codes/{id}","href":"expenses/getexpensecodebyid","openApiOperationId":"getExpenseCodeById","summary":"Get an expense code by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Expense code retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No expense code has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1expense-codes~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/expenses/getexpensecodebyid"}],"panels":[]}]},"httpPath":"/api/v1/expense-codes/{id}"},{"label":"Create or update expense entries (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/expenses/upsertexpenseentries","routeSlug":"/bundle/expenses/upsertexpenseentries","metadata":{"seo":{"title":"Create or update expense entries (upsert)","description":"🔐 Required role: TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertExpenseEntries","name":"Create or update expense entries (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1expense-entries/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update expense entries (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update expense entries (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is always"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Expense"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" sent in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is replaced. Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the entry its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the entry with that"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a new entry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"is created. Attributes left out of an update keep their values. A record with any field other than"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"see below"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"date-time"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Date of the expense; see below."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member who incurred the expense."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client the expense is for."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Expense code "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; an active code is preferred when several share it."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the expense code; wins over "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Expense amount."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the expense amount."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the expense amount."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Amount already billed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a new expense."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Amount written off. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a new expense."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billable"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the expense is billable."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"posted"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the expense is posted."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"approved"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the expense is approved."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"notes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Expense description."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note for your firm."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the expense."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Without "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", a new entry takes "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef.system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PM"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and a generated"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference otherwise. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an ISO-8601 date-time with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or an offset, for example"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"2026-06-17T00:00:00Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; an offset is converted to UTC. A date alone, or a date-time without "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or an"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"offset, fails with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"VALIDATION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No rate is resolved for an expense; it is stored as sent. Send what the firm portal stores: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" equal to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Select"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the expense code with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"expenseCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record fails with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_CLIENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_PROJECT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_RESOURCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the client, project or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff member is inactive, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"REFERENCE_MISMATCH"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the project belongs to another client, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"LOCKED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entry is already on an invoice, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CONVERSION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for an unknown "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNRESOLVED_REFERENCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" matches no staff member, client or project (an Aiwyn ID is stored as sent, without a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"check), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"BUILD_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a required attribute is missing, and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"VALIDATION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a negative "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"blank "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or an invalid "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reading an expense entry back (paged lookup or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/expense-entries/{id}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") does not return "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", its stored "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"s or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"custom fields: they come back empty or as their defaults. The values you send are stored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom fields your firm defines for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are accepted too; list them with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none succeeded —"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-entries/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-entries/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1expense-entries/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/expense-entries","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-entries/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/expense-entries","href":"expenses/upsertexpenseentries","openApiOperationId":"upsertExpenseEntries","summary":"Create or update expense entries (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-entries/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1expense-entries/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All expense entries processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1expense-entries/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/expenses/upsertexpenseentries"}],"panels":[]}]},"httpPath":"/api/v1/expense-entries"},{"label":"Lookup expense entries in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/expenses/pagedlookupexpenseentries","routeSlug":"/bundle/expenses/pagedlookupexpenseentries","metadata":{"seo":{"title":"Lookup expense entries in pages","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupExpenseEntries","name":"Lookup expense entries in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1expense-entries~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup expense entries in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup expense entries in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of active "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records; a deactivated entry is not listed. Records do not carry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"costPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedPerUnit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billedAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"writeOffAmount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", stored "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"s or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"custom fields; see the upsert."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1expense-entries~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/expense-entries/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/expense-entries/batch","href":"expenses/pagedlookupexpenseentries","openApiOperationId":"pagedLookupExpenseEntries","summary":"Lookup expense entries in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1expense-entries~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/expenses/pagedlookupexpenseentries"}],"panels":[]}]},"httpPath":"/api/v1/expense-entries/batch"},{"label":"Get an expense entry by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/expenses/getexpenseentrybyid","routeSlug":"/bundle/expenses/getexpenseentrybyid","metadata":{"seo":{"title":"Get an expense entry by Aiwyn ID","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getExpenseEntryById","name":"Get an expense entry by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1expense-entries~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get an expense entry by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get an expense entry by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup. Only"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active entries are returned, as in the paged lookup. An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ExpenseEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the entry, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1expense-entries~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/expense-entries/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/expense-entries/{id}","href":"expenses/getexpenseentrybyid","openApiOperationId":"getExpenseEntryById","summary":"Get an expense entry by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Expense entry retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No expense entry has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1expense-entries~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/expenses/getexpenseentrybyid"}],"panels":[]}]},"httpPath":"/api/v1/expense-entries/{id}"}],"content":{"contentType":"group","meta":{"name":"Expenses"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Expenses","showPageActions":true},{"nodeType":"markdoc","content":"Create, update and look up expense codes, which classify expense entries, and expense entries."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v1/expense-codes","summary":"Create or update expense codes (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/expenses/upsertexpensecodes","deprecated":false},{"title":"/api/v1/expense-codes/batch","summary":"Lookup expense codes in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/expenses/pagedlookupexpensecodes","deprecated":false},{"title":"/api/v1/expense-codes/{id}","summary":"Get an expense code by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/expenses/getexpensecodebyid","deprecated":false},{"title":"/api/v1/expense-entries","summary":"Create or update expense entries (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/expenses/upsertexpenseentries","deprecated":false},{"title":"/api/v1/expense-entries/batch","summary":"Lookup expense entries in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/expenses/pagedlookupexpenseentries","deprecated":false},{"title":"/api/v1/expense-entries/{id}","summary":"Get an expense entry by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/expenses/getexpenseentrybyid","deprecated":false}]}]}]}]}},{"type":"group","label":"Operational","link":"/bundle/operational","routeSlug":"/bundle/operational","items":[{"label":"Create or update operational codes (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/operational/upsertoperationalcodes","routeSlug":"/bundle/operational/upsertoperationalcodes","metadata":{"seo":{"title":"Create or update operational codes (upsert)","description":"🔐 Required role: TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertOperationalCodes","name":"Create or update operational codes (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1operational-codes/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update operational codes (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update operational codes (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operational codes classify non-client operational time."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Maximum 100 records"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the code its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the code with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"that Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"new code is created. Attributes left out of an update keep their values. A record with any field"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"other than "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Some older operational codes appear in the lookup but aren't matched here, so sending one creates"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a new operational code."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"generated"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Code value that operational entries reference."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"display"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Name shown in Aiwyn."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"description"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Longer description."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the code."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom fields your firm defines for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are accepted too; list them with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/codes/schema/OperationalCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-codes/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-codes/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1operational-codes/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/operational-codes","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-codes/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/operational-codes","href":"operational/upsertoperationalcodes","openApiOperationId":"upsertOperationalCodes","summary":"Create or update operational codes (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-codes/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-codes/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All operational codes processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1operational-codes/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/operational/upsertoperationalcodes"}],"panels":[]}]},"httpPath":"/api/v1/operational-codes"},{"label":"Lookup operational codes in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/operational/pagedlookupoperationalcodes","routeSlug":"/bundle/operational/pagedlookupoperationalcodes","metadata":{"seo":{"title":"Lookup operational codes in pages","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupOperationalCodes","name":"Lookup operational codes in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1operational-codes~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup operational codes in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup operational codes in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1operational-codes~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/operational-codes/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/operational-codes/batch","href":"operational/pagedlookupoperationalcodes","openApiOperationId":"pagedLookupOperationalCodes","summary":"Lookup operational codes in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1operational-codes~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/operational/pagedlookupoperationalcodes"}],"panels":[]}]},"httpPath":"/api/v1/operational-codes/batch"},{"label":"Get an operational code by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/operational/getoperationalcodebyid","routeSlug":"/bundle/operational/getoperationalcodebyid","metadata":{"seo":{"title":"Get an operational code by Aiwyn ID","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getOperationalCodeById","name":"Get an operational code by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1operational-codes~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get an operational code by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get an operational code by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the code, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1operational-codes~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/operational-codes/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/operational-codes/{id}","href":"operational/getoperationalcodebyid","openApiOperationId":"getOperationalCodeById","summary":"Get an operational code by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Operational code retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No operational code has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1operational-codes~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/operational/getoperationalcodebyid"}],"panels":[]}]},"httpPath":"/api/v1/operational-codes/{id}"},{"label":"Create or update operational entries (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/operational/upsertoperationalentries","routeSlug":"/bundle/operational/upsertoperationalentries","metadata":{"seo":{"title":"Create or update operational entries (upsert)","description":"🔐 Required role: TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertOperationalEntries","name":"Create or update operational entries (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1operational-entries/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update operational entries (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update operational entries (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Maximum 100 records per"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the entry its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the entry with that"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a new entry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"is created. Attributes left out of an update keep their values. A record with any field other than"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"generated"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedAt"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"date-time"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When the time was logged; see below."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operational code "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; an active code is preferred when several share it."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"operationalCodeId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the operational code; wins over "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Hours."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"comment"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Comment."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note for your firm."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"serviceLineId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Service line."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"status"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"DRAFT"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"DRAFT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"SUBMITTED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"submittedStaffId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member who submitted it."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"submittedDate"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"date-time"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When it was submitted."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the entry."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Select the operational code with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operationalCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; one of them is required. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" takes a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"date (read as midnight), a date-time without an offset (stored as sent), or one with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or an offset"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(converted to UTC)."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record fails with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_RESOURCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the staff member is inactive, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CONVERSION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for an unknown"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNRESOLVED_REFERENCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" matches no staff member, service line or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"submitting staff member (an Aiwyn ID is stored as sent, without a check), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"BUILD_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a required"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attribute, or both the code and its ID, are missing, and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"VALIDATION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a negative "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"blank "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom fields your firm defines for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are accepted too; list them with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/OperationalEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none succeeded —"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-entries/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-entries/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1operational-entries/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/operational-entries","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-entries/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/operational-entries","href":"operational/upsertoperationalentries","openApiOperationId":"upsertOperationalEntries","summary":"Create or update operational entries (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-entries/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1operational-entries/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All operational entries processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1operational-entries/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/operational/upsertoperationalentries"}],"panels":[]}]},"httpPath":"/api/v1/operational-entries"},{"label":"Lookup operational entries in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/operational/pagedlookupoperationalentries","routeSlug":"/bundle/operational/pagedlookupoperationalentries","metadata":{"seo":{"title":"Lookup operational entries in pages","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupOperationalEntries","name":"Lookup operational entries in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1operational-entries~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup operational entries in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup operational entries in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of active "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records; a deactivated entry is not listed."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1operational-entries~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/operational-entries/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/operational-entries/batch","href":"operational/pagedlookupoperationalentries","openApiOperationId":"pagedLookupOperationalEntries","summary":"Lookup operational entries in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1operational-entries~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/operational/pagedlookupoperationalentries"}],"panels":[]}]},"httpPath":"/api/v1/operational-entries/batch"},{"label":"Get an operational entry by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/operational/getoperationalentrybyid","routeSlug":"/bundle/operational/getoperationalentrybyid","metadata":{"seo":{"title":"Get an operational entry by Aiwyn ID","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getOperationalEntryById","name":"Get an operational entry by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1operational-entries~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get an operational entry by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get an operational entry by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Only active entries are returned, as in the paged lookup. An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OperationalEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the entry, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1operational-entries~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/operational-entries/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/operational-entries/{id}","href":"operational/getoperationalentrybyid","openApiOperationId":"getOperationalEntryById","summary":"Get an operational entry by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Operational entry retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No operational entry has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1operational-entries~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/operational/getoperationalentrybyid"}],"panels":[]}]},"httpPath":"/api/v1/operational-entries/{id}"}],"content":{"contentType":"group","meta":{"name":"Operational"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Operational","showPageActions":true},{"nodeType":"markdoc","content":"Create, update and look up operational codes and the operational entries that log non-client time\nagainst them."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v1/operational-codes","summary":"Create or update operational codes (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/operational/upsertoperationalcodes","deprecated":false},{"title":"/api/v1/operational-codes/batch","summary":"Lookup operational codes in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/operational/pagedlookupoperationalcodes","deprecated":false},{"title":"/api/v1/operational-codes/{id}","summary":"Get an operational code by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/operational/getoperationalcodebyid","deprecated":false},{"title":"/api/v1/operational-entries","summary":"Create or update operational entries (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/operational/upsertoperationalentries","deprecated":false},{"title":"/api/v1/operational-entries/batch","summary":"Lookup operational entries in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/operational/pagedlookupoperationalentries","deprecated":false},{"title":"/api/v1/operational-entries/{id}","summary":"Get an operational entry by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/operational/getoperationalentrybyid","deprecated":false}]}]}]}]}},{"type":"group","label":"PTO","link":"/bundle/pto","routeSlug":"/bundle/pto","items":[{"label":"Create or update PTO codes (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/pto/upsertptocodes","routeSlug":"/bundle/pto/upsertptocodes","metadata":{"seo":{"title":"Create or update PTO codes (upsert)","description":"🔐 Required role: TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertPtoCodes","name":"Create or update PTO codes (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1pto-codes/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update PTO codes (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update PTO codes (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PTO codes classify paid time off such as vacation or sick leave."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the code its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the code with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"that Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the code whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"new code is created. Attributes left out of an update keep their values. A record with any field"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"other than "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"generated"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Code value that PTO entries reference."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Notes for your firm; PTO codes have no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"display"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the code."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom fields your firm defines for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are accepted too; list them with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/codes/schema/PtoCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-codes/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-codes/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1pto-codes/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/pto-codes","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-codes/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/pto-codes","href":"pto/upsertptocodes","openApiOperationId":"upsertPtoCodes","summary":"Create or update PTO codes (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-codes/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-codes/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All PTO codes processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1pto-codes/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pto/upsertptocodes"}],"panels":[]}]},"httpPath":"/api/v1/pto-codes"},{"label":"Lookup PTO codes in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/pto/pagedlookupptocodes","routeSlug":"/bundle/pto/pagedlookupptocodes","metadata":{"seo":{"title":"Lookup PTO codes in pages","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupPtoCodes","name":"Lookup PTO codes in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1pto-codes~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup PTO codes in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup PTO codes in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1pto-codes~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/pto-codes/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/pto-codes/batch","href":"pto/pagedlookupptocodes","openApiOperationId":"pagedLookupPtoCodes","summary":"Lookup PTO codes in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1pto-codes~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pto/pagedlookupptocodes"}],"panels":[]}]},"httpPath":"/api/v1/pto-codes/batch"},{"label":"Get a PTO code by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/pto/getptocodebyid","routeSlug":"/bundle/pto/getptocodebyid","metadata":{"seo":{"title":"Get a PTO code by Aiwyn ID","description":"🔐 Required role: TM_CODE_R or TM_CODE_C📖 Data dictionary: Time-management code"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getPtoCodeById","name":"Get a PTO code by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1pto-codes~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get a PTO code by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_CODE_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-code"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management code"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get a PTO code by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the code, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1pto-codes~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/pto-codes/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/pto-codes/{id}","href":"pto/getptocodebyid","openApiOperationId":"getPtoCodeById","summary":"Get a PTO code by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"PTO code retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_CODE_R, TM_CODE_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No PTO code has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1pto-codes~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pto/getptocodebyid"}],"panels":[]}]},"httpPath":"/api/v1/pto-codes/{id}"},{"label":"Create or update PTO entries (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/pto/upsertptoentries","routeSlug":"/bundle/pto/upsertptoentries","metadata":{"seo":{"title":"Create or update PTO entries (upsert)","description":"🔐 Required role: TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"upsertPtoEntries","name":"Create or update PTO entries (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1pto-entries/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update PTO entries (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update PTO entries (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every record is saved with type "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so records carry no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record updates the entry its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" names: the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the entry with that"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"system"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwyn"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", or else the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Without a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it updates the entry whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes.pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When nothing matches, a new entry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"is created. Attributes left out of an update keep their values. A record with any field other than"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"systemRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"attributes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected with 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Attribute"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Description"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"generated"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference in your practice management system."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedAt"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"date-time"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Day of the time off; see below."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Yes"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member taking the time off."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"PTO code "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; an active code is preferred when several share it."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ptoCodeId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the PTO code; wins over "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"number"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Hours or days, as your firm records PTO."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"comments"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Comments."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"internalNotes"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note for your firm."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"status"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"string"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"DRAFT"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"DRAFT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"SUBMITTED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"submittedStaffId"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member who submitted it."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"submittedDate"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"date-time"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"—"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When it was submitted."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"boolean"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"No"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"true"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" deactivates the entry."},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Select the PTO code with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ptoCodeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; one of them is required. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" takes a date (read as"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"midnight), a date-time without an offset (stored as sent), or one with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Z"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or an offset (converted to UTC)."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A record fails with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INACTIVE_RESOURCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the staff member is inactive, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CONVERSION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for an unknown"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNRESOLVED_REFERENCE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{system, reference}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" matches no staff member or submitting staff"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"member (an Aiwyn ID is stored as sent, without a check), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"BUILD_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a required attribute, or both"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the code and its ID, are missing, and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"VALIDATION_ERROR"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a negative "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"units"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or a blank "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"reference"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" in"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"loggedStaffId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom fields your firm defines for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are accepted too; list them with"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/entries/schema/PtoEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record succeeds or fails on its own: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"207"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" say whether all, some or none succeeded —"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors#batch-writes-per-record-results"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Batch writes: per-record results"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-entries/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-entries/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1pto-entries/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/pto-entries","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-entries/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","207","400","401","403","422","500"],"pointer":"/api/v1/pto-entries","href":"pto/upsertptoentries","openApiOperationId":"upsertPtoEntries","summary":"Create or update PTO entries (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-entries/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_94","exampleIds":["paths/~1api~1v1~1pto-entries/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"All PTO entries processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"207","description":"Partial success - some records failed; data.records carries each record's status and error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"Every record failed; data.records carries each record's error, meta.success is false","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1pto-entries/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"207","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pto/upsertptoentries"}],"panels":[]}]},"httpPath":"/api/v1/pto-entries"},{"label":"Lookup PTO entries in pages","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/pto/pagedlookupptoentries","routeSlug":"/bundle/pto/pagedlookupptoentries","metadata":{"seo":{"title":"Lookup PTO entries in pages","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"pagedLookupPtoEntries","name":"Lookup PTO entries in pages","isWebhook":false,"pointer":"/paths/~1api~1v1~1pto-entries~1batch/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup PTO entries in pages","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup PTO entries in pages"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns one page of active "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records; a deactivated entry is not listed."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request body:"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"pageSize\": 25, \"page\": 0 }"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is 1 to 100 (default 25) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a zero-based page index, not a record offset; see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#time-management-code-and-entry-lookups"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"management code and entry lookups"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"schemaId":"schema_92","pointer":"/paths/~1api~1v1~1pto-entries~1batch/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/pto-entries/batch","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92"}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/pto-entries/batch","href":"pto/pagedlookupptoentries","openApiOperationId":"pagedLookupPtoEntries","summary":"Lookup PTO entries in pages","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}},"schemaId":"schema_93"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1pto-entries~1batch/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_93","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_93"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pto/pagedlookupptoentries"}],"panels":[]}]},"httpPath":"/api/v1/pto-entries/batch"},{"label":"Get a PTO entry by Aiwyn ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/pto/getptoentrybyid","routeSlug":"/bundle/pto/getptoentrybyid","metadata":{"seo":{"title":"Get a PTO entry by Aiwyn ID","description":"🔐 Required role: TM_ENTRY_R or TM_ENTRY_C📖 Data dictionary: Time-management entry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getPtoEntryById","name":"Get a PTO entry by Aiwyn ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1pto-entries~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get a PTO entry by Aiwyn ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TM_ENTRY_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/time-management-entry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Time-management entry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get a PTO entry by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", in the same shape as a record of the paged lookup. Only"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active entries are returned, as in the paged lookup. An ID that belongs to no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PtoEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns 404."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn ID of the entry, as returned in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"aiwynId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" by the upsert or the paged lookup."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1pto-entries~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/pto-entries/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/pto-entries/{id}","href":"pto/getptoentrybyid","openApiOperationId":"getPtoEntryById","summary":"Get a PTO entry by Aiwyn ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"PTO entry retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}},"schemaId":"schema_96"},{"code":"400","description":"The ID is not a positive number"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of TM_ENTRY_R, TM_ENTRY_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No PTO entry has this ID"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1pto-entries~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_96","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_96"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/pto/getptoentrybyid"}],"panels":[]}]},"httpPath":"/api/v1/pto-entries/{id}"}],"content":{"contentType":"group","meta":{"name":"PTO"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"PTO","showPageActions":true},{"nodeType":"markdoc","content":"Create, update and look up PTO codes and the PTO entries that record paid time off against them."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v1/pto-codes","summary":"Create or update PTO codes (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/pto/upsertptocodes","deprecated":false},{"title":"/api/v1/pto-codes/batch","summary":"Lookup PTO codes in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/pto/pagedlookupptocodes","deprecated":false},{"title":"/api/v1/pto-codes/{id}","summary":"Get a PTO code by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/pto/getptocodebyid","deprecated":false},{"title":"/api/v1/pto-entries","summary":"Create or update PTO entries (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/pto/upsertptoentries","deprecated":false},{"title":"/api/v1/pto-entries/batch","summary":"Lookup PTO entries in pages","prefix":{"name":"post","color":"post"},"badges":[],"link":"/pto/pagedlookupptoentries","deprecated":false},{"title":"/api/v1/pto-entries/{id}","summary":"Get a PTO entry by Aiwyn ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/pto/getptoentrybyid","deprecated":false}]}]}]}]}},{"type":"separator","label":"Firm setup","content":null},{"type":"group","label":"Staff","link":"/bundle/staff","routeSlug":"/bundle/staff","items":[{"label":"List staff","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/staff/getstaff","routeSlug":"/bundle/staff/getstaff","metadata":{"seo":{"title":"List staff","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Staff"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getStaff","name":"List staff","isWebhook":false,"pointer":"/paths/~1gql~1v1~1staff/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List staff","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/staff"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff directory and human resource management with organizational structure"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination (v1 — limit/offset, see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"):"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a limit (records to return)."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an offset (records to skip), not a page index. Hasura maps these as"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit: $pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"offset: $page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is at or beyond"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the result array is empty."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This endpoint returns the staff directory, ordered by last name, first name, then id"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"descending. It accepts only "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; any other body property is rejected"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"with 400 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unexpected variable <name>"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"To filter or sort"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (by active status, department, name, role, …), use"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/staff/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"orderBy"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Employee directory and contact management"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"HR reporting and organizational analysis"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Department staff allocation and planning"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Employee onboarding and management workflows"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration with external HR and payroll systems"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Directory Features:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Complete contact information management"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Department, service line, role, permission, and supervisor relationship tracking"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff reference system for external integration"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Employee status and lifecycle management"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_97","exampleIds":["paths/~1gql~1v1~1staff/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_97","exampleIds":["paths/~1gql~1v1~1staff/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1staff/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/staff","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_97","exampleIds":["paths/~1gql~1v1~1staff/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/staff","href":"staff/getstaff","openApiOperationId":"getStaff","summary":"List staff","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_97","exampleIds":["paths/~1gql~1v1~1staff/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_97","exampleIds":["paths/~1gql~1v1~1staff/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved staff records","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_98","exampleIds":["paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"schema_98","exampleIds":["paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Bad request. An out-of-range "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or a negative "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected before the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"query runs, with only "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/errors"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Errors"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). A body property other"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"than "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is rejected by the query with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"code"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"path"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/negative_page","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/unexpected_variable"]}},"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/negative_page","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/unexpected_variable"]},{"code":"401","description":"Unauthorized - insufficient permissions","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1staff/post/responses/401/content/application~1json/examples/insufficient_permissions"]}},"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1staff/post/responses/401/content/application~1json/examples/insufficient_permissions"]},{"code":"500","description":"Internal server error","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}},"schemaId":"schema_10"}],"pointer":"/paths/~1gql~1v1~1staff/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_98","exampleIds":["paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_98","exampleIds":["paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/successful_response","paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400","schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/negative_page","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/unexpected_variable"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/invalid_page_size","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/negative_page","paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/unexpected_variable"]}}},{"code":"401","schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1staff/post/responses/401/content/application~1json/examples/insufficient_permissions"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10","exampleIds":["paths/~1gql~1v1~1staff/post/responses/401/content/application~1json/examples/insufficient_permissions"]}}},{"code":"500","schemaId":"schema_10","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_10"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/staff/getstaff"}],"panels":[]}]},"httpPath":"/gql/v1/staff"},{"label":"Search staff","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/staff/filterstaffdynamic","routeSlug":"/bundle/staff/filterstaffdynamic","metadata":{"seo":{"title":"Search staff","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Staff"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"filterStaffDynamic","name":"Search staff","isWebhook":false,"pointer":"/paths/~1gql~1v1~1staff~1search/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Search staff","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/staff"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Advanced staff filtering with flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clauses and dynamic ordering"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Provides flexible, enterprise-grade filtering for staff directory queries with boolean logic,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"relationship traversal, and multi-field ordering."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each result includes service and sub-service lines, wage and employee types, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"role"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(formerly "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), permission set, supervisor, and the record's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"updatedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" timestamp."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Key capabilities include boolean operators ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_and"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_or"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_not"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), text matching ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_ilike"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"),"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"comparison operators ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_gt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_gte"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_lt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_lte"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_eq"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_neq"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), array operators ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_in"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_nin"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"),"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and nested/related filtering (e.g., by office or manager)."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_99","exampleIds":["paths/~1gql~1v1~1staff~1search/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_99","exampleIds":["paths/~1gql~1v1~1staff~1search/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1gql~1v1~1staff~1search/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/staff/search","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_99","exampleIds":["paths/~1gql~1v1~1staff~1search/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/staff/search","href":"staff/filterstaffdynamic","openApiOperationId":"filterStaffDynamic","summary":"Search staff","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_99","exampleIds":["paths/~1gql~1v1~1staff~1search/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_99","exampleIds":["paths/~1gql~1v1~1staff~1search/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved filtered staff with dynamic ordering","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_100","exampleIds":["paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/filtered_response","paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/empty_response"]}},"schemaId":"schema_100","exampleIds":["paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/filtered_response","paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/empty_response"]},{"code":"400","description":"Bad request - invalid where/orderBy"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1staff~1search/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_100","exampleIds":["paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/filtered_response","paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/empty_response"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_100","exampleIds":["paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/filtered_response","paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/empty_response"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/staff/filterstaffdynamic"}],"panels":[]}]},"httpPath":"/gql/v1/staff/search"},{"label":"Get staff member by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/staff/getstaffbyid","routeSlug":"/bundle/staff/getstaffbyid","metadata":{"seo":{"title":"Get staff member by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Staff"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getStaffById","name":"Get staff member by ID","isWebhook":false,"pointer":"/paths/~1gql~1v1~1staff~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get staff member by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/staff"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns a staff member's full profile:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member ID and PMS reference"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Personal information (first name, last name, email)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Active status indicator"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Department and office assignments"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Job title and role (when available)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Service line and sub-service line"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Wage type and employee type"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Permission set, manager, and supervisor assignments"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Last-updated timestamp"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member lookup and verification"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Organizational structure queries"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Basic staff information retrieval"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Department and office staff management"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" the record is wrapped in a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" key. An id that does not exist"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns 200 with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"staff\": null}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (not 404). A non-numeric id returns 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"staff\": {\n    \"id\": 202,\n    \"pmsRef\": \"2254\",\n    \"firstName\": \"Holley\",\n    \"lastName\": \"Abbott\",\n    \"email\": \"ena.toy@hotmail.com\",\n    \"active\": true,\n    \"deptId\": 8,\n    \"jobTitle\": null,\n    \"type\": null,\n    \"officeId\": 2,\n    \"serviceLine\": { \"id\": 4, \"pmsRef\": \"TAX\", \"name\": \"Tax\" },\n    \"subServiceLine\": { \"id\": 12, \"pmsRef\": \"TAX-COMP\", \"name\": \"Tax Compliance\" },\n    \"wageType\": { \"id\": 1, \"pmsRef\": \"SAL\", \"name\": \"Salary\" },\n    \"employeeType\": { \"id\": 2, \"pmsRef\": \"FT\", \"name\": \"Full Time\" },\n    \"role\": {\n      \"id\": 11,\n      \"pmsRef\": \"MANAGER\",\n      \"display\": \"Manager\",\n      \"description\": \"Manager\"\n    },\n    \"permissionSet\": { \"id\": 3, \"name\": \"Standard Manager\" },\n    \"staffSupervisor\": {\n      \"id\": 53,\n      \"pmsRef\": \"A53\",\n      \"staffRef\": \"AH\",\n      \"firstName\": \"Allen\",\n      \"lastName\": \"Hermiston\",\n      \"email\": \"allen.hermiston@company.com\"\n    },\n    \"staffManagerId\": 53,\n    \"updatedAt\": \"2026-09-21T18:30:00Z\"\n  }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"staff\": {\n    \"id\": 202,\n    \"pmsRef\": \"2254\",\n    \"firstName\": \"Holley\",\n    \"lastName\": \"Abbott\",\n    \"email\": \"ena.toy@hotmail.com\",\n    \"active\": true,\n    \"deptId\": 8,\n    \"jobTitle\": null,\n    \"type\": null,\n    \"officeId\": 2,\n    \"serviceLine\": { \"id\": 4, \"pmsRef\": \"TAX\", \"name\": \"Tax\" },\n    \"subServiceLine\": { \"id\": 12, \"pmsRef\": \"TAX-COMP\", \"name\": \"Tax Compliance\" },\n    \"wageType\": { \"id\": 1, \"pmsRef\": \"SAL\", \"name\": \"Salary\" },\n    \"employeeType\": { \"id\": 2, \"pmsRef\": \"FT\", \"name\": \"Full Time\" },\n    \"role\": {\n      \"id\": 11,\n      \"pmsRef\": \"MANAGER\",\n      \"display\": \"Manager\",\n      \"description\": \"Manager\"\n    },\n    \"permissionSet\": { \"id\": 3, \"name\": \"Standard Manager\" },\n    \"staffSupervisor\": {\n      \"id\": 53,\n      \"pmsRef\": \"A53\",\n      \"staffRef\": \"AH\",\n      \"firstName\": \"Allen\",\n      \"lastName\": \"Hermiston\",\n      \"email\": \"allen.hermiston@company.com\"\n    },\n    \"staffManagerId\": 53,\n    \"updatedAt\": \"2026-09-21T18:30:00Z\"\n  }\n}\n"},"children":[],"type":"text"}],"type":"fence"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_11","description":"Unique identifier of the staff member","required":true,"example":123}],"pointer":"/paths/~1gql~1v1~1staff~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/gql/v1/staff/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":123,"schemaId":"schema_11"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/gql/v1/staff/{id}","href":"staff/getstaffbyid","openApiOperationId":"getStaffById","summary":"Get staff member by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member lookup result. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the directory record, or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when no"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staff member has that id."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_101","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/not_found"]}},"schemaId":"schema_101","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/not_found"]},{"code":"400","description":"Bad request - the id is not an integer","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}},"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":"Forbidden - Insufficient permissions to access this staff member"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1staff~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_101","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/not_found"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_101","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/found","paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/not_found"]}}},{"code":"400","schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_13","exampleIds":["paths/~1gql~1v1~1staff~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"]}}},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/staff/getstaffbyid"}],"panels":[]}]},"httpPath":"/gql/v1/staff/{id}"},{"label":"Onboard a new staff member","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/staff/onboardstaff","routeSlug":"/bundle/staff/onboardstaff","metadata":{"seo":{"title":"Onboard a new staff member","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Staff"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"onboardStaff","name":"Onboard a new staff member","isWebhook":false,"pointer":"/paths/~1api~1v1~1staff/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Onboard a new staff member","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/staff"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create a new staff member, optionally assigning them to a rate card"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates a staff record and, when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardAssignment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is provided, atomically"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"creates the corresponding billing rate and average cost records in the same"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"transaction."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required fields:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"firstName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — staff member's first name"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"lastName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — staff member's last name"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — practice management system reference"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ref"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — unique staff reference code"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Rate card assignment"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardAssignment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"):"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"When provided, the rate card must already exist. Each entry in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingRates"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"requires a valid "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". All three records (staff, billing rates, average"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"cost) are created atomically — if any write fails the entire request is rolled back."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — ID of an existing rate card (validated before any writes)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingRates"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — one record per rate type; each requires a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"averageCost"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — single average hourly cost for this staff member (optional)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_102","exampleIds":["paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/with_rate_card"]}},"schemaId":"schema_102","exampleIds":["paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/with_rate_card"],"pointer":"/paths/~1api~1v1~1staff/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/staff","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_102","exampleIds":["paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/with_rate_card"]}},"responseCodes":["201","400","401","403","500"],"pointer":"/api/v1/staff","href":"staff/onboardstaff","openApiOperationId":"onboardStaff","summary":"Onboard a new staff member","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_102","exampleIds":["paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/with_rate_card"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_102","exampleIds":["paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/minimal","paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/with_rate_card"]}},"examples":[{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"201","description":"Staff member created successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_103","exampleIds":["paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_only","paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_with_rate_card"]}},"schemaId":"schema_103","exampleIds":["paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_only","paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_with_rate_card"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invalid request. Common causes:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Missing required fields ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"firstName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"lastName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ref"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardAssignment.rateCardId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" does not reference an existing rate card"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"One or more "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingRates"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" do not exist"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unauthorized — missing or invalid bearer token"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden — token does not have the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ROLE_API_ADMIN"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" role"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1staff/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"201","schemaId":"schema_103","exampleIds":["paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_only","paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_with_rate_card"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_103","exampleIds":["paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_only","paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_with_rate_card"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/staff/onboardstaff"}],"panels":[]}]},"httpPath":"/api/v1/staff"},{"label":"Update a staff member","deprecated":false,"httpVerb":"put","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/staff/updatestaff","routeSlug":"/bundle/staff/updatestaff","metadata":{"seo":{"title":"Update a staff member","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Staff"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"updateStaff","name":"Update a staff member","isWebhook":false,"pointer":"/paths/~1api~1v1~1staff~1{staffId}/put","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Update a staff member","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/staff"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Update an existing staff member's profile and optionally replace their rate card assignment"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"All fields are optional — only the fields you include will be updated. Omitted fields"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"retain their current values."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Rate card assignment replacement"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardAssignment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"):"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"When provided, this operation atomically:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Deactivates "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"all"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" active "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rate_card_staff_billing_rate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rate_card_staff_average_cost"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" records currently linked to this staff member"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(across any rate card)."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates new records for the specified "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Omitting "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardAssignment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" entirely leaves existing rate card records untouched."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pre-write validation ensures "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and all "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values reference"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"existing records — if any are invalid the entire request is rejected with HTTP 400"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and no changes are written."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"staffId","in":"path","schemaId":"schema_35","description":"Unique identifier of the staff member to update","required":true,"example":312}],"pointer":"/paths/~1api~1v1~1staff~1{staffId}/put/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_104","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_only","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/replace_rate_card","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_and_rate_card"]}},"schemaId":"schema_104","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_only","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/replace_rate_card","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_and_rate_card"],"pointer":"/paths/~1api~1v1~1staff~1{staffId}/put/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"PUT","path":"/api/v1/staff/{staffId}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"staffId","in":"path","required":true,"example":312,"schemaId":"schema_35"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_104","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_only","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/replace_rate_card","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_and_rate_card"]}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/staff/{staffId}","href":"staff/updatestaff","openApiOperationId":"updateStaff","summary":"Update a staff member","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_104","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_only","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/replace_rate_card","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_and_rate_card"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_104","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_only","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/replace_rate_card","paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_and_rate_card"]}},"examples":[{},{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Staff member updated successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_105","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/fields_updated","paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/rate_card_replaced"]}},"schemaId":"schema_105","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/fields_updated","paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/rate_card_replaced"]},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invalid request. Common causes:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardAssignment.rateCardId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" does not reference an existing rate card"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"One or more "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingRates"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" do not exist"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unauthorized — missing or invalid bearer token"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden — token does not have the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ROLE_API_ADMIN"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" role"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff member not found for the given "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffId"},"children":[],"type":"code"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1staff~1{staffId}/put/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_105","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/fields_updated","paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/rate_card_replaced"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_105","exampleIds":["paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/fields_updated","paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/rate_card_replaced"]}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/staff/updatestaff"}],"panels":[]}]},"httpPath":"/api/v1/staff/{staffId}"},{"label":"Create staff types in batch","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/staff/stafftypebatchcreate","routeSlug":"/bundle/staff/stafftypebatchcreate","metadata":{"seo":{"title":"Create staff types in batch","description":"🔐 Required role: STF_TYP_C📖 Data dictionary: Staff"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"StaffTypeBatchCreate","name":"Create staff types in batch","isWebhook":false,"pointer":"/paths/~1api~1v1~1staff~1type~1batch~1create/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create staff types in batch","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"STF_TYP_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/staff"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create staff types in batch"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates up to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"100"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" staff types in a single request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Notes:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The request body is JSON "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ \"items\": [ ... ] }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" where "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"items"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an array of staff type objects (same shape as single "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/create"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"items"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" must contain "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1–100"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" elements; otherwise the request is rejected with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"400"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Successful creates appear under "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; failures appear under "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"failed"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with an error message (partial success is allowed)."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"201"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when every item succeeds; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"422"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when every item fails; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"200"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when there is a mix of successes and failures."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response body (201, 200 and 422):"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" the body is not wrapped in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"meta"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". It always has"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"both arrays; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the item's position in the request "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"items"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"succeeded\": [ { \"index\": 0, \"display\": \"Associate\", \"id\": 41 } ],\n  \"failed\": [ { \"index\": 1, \"display\": \"Manager\", \"message\": \"Sorry, the specified permission set was not found or is not active.\" } ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"succeeded\": [ { \"index\": 0, \"display\": \"Associate\", \"id\": 41 } ],\n  \"failed\": [ { \"index\": 1, \"display\": \"Manager\", \"message\": \"Sorry, the specified permission set was not found or is not active.\" } ]\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"succeeded[]"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (integer), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"display"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (string), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (integer, id of the new staff type)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"failed[]"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (integer), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"display"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (string), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"message"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (string, why the item was not created)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_106","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_106","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/staff/type/batch/create","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_106","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","201","400","401","403","422","500"],"pointer":"/api/v1/staff/type/batch/create","href":"staff/stafftypebatchcreate","openApiOperationId":"StaffTypeBatchCreate","summary":"Create staff types in batch","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_106","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_106","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Partial success — some staff types were created and some failed"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_107"}},"schemaId":"schema_107"},{"code":"201","description":"All staff types were created successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_107"}},"schemaId":"schema_107"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires STF_TYP_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"422","description":"None of the staff types could be created","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_107"}},"schemaId":"schema_107"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1staff~1type~1batch~1create/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_107","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_107"}}},{"code":"201","schemaId":"schema_107","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_107"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"422","schemaId":"schema_107","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_107"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/staff/stafftypebatchcreate"}],"panels":[]}]},"httpPath":"/api/v1/staff/type/batch/create"},{"label":"Lookup staff types (paged)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/staff/stafftypebatchlookup","routeSlug":"/bundle/staff/stafftypebatchlookup","metadata":{"seo":{"title":"Lookup staff types (paged)","description":"🔐 Required role: STF_TYP_R or STF_TYP_C📖 Data dictionary: Staff"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"StaffTypeBatchLookup","name":"Lookup staff types (paged)","isWebhook":false,"pointer":"/paths/~1api~1v1~1staff~1type~1batch~1lookup/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Lookup staff types (paged)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"STF_TYP_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"STF_TYP_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/staff"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lookup staff types page by page"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns a page of staff types ordered by id ascending."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Notes:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" must be between "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"100"},"children":[],"type":"text"}],"type":"strong"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is zero-based ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 0 is the first page)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_92","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/staff/type/batch/lookup","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_92","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/staff/type/batch/lookup","href":"staff/stafftypebatchlookup","openApiOperationId":"StaffTypeBatchLookup","summary":"Lookup staff types (paged)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_92","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_92","exampleIds":["paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Lookup completed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_108"}},"schemaId":"schema_108"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of STF_TYP_R, STF_TYP_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1staff~1type~1batch~1lookup/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_108","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_108"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/staff/stafftypebatchlookup"}],"panels":[]}]},"httpPath":"/api/v1/staff/type/batch/lookup"}],"content":{"contentType":"group","meta":{"name":"Staff"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Staff","showPageActions":true},{"nodeType":"markdoc","content":"Manage staff accounts, roles, and permissions."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/staff","summary":"List staff","prefix":{"name":"post","color":"post"},"badges":[],"link":"/staff/getstaff","deprecated":false},{"title":"/gql/v1/staff/search","summary":"Search staff","prefix":{"name":"post","color":"post"},"badges":[],"link":"/staff/filterstaffdynamic","deprecated":false},{"title":"/gql/v1/staff/{id}","summary":"Get staff member by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/staff/getstaffbyid","deprecated":false},{"title":"/api/v1/staff","summary":"Onboard a new staff member","prefix":{"name":"post","color":"post"},"badges":[],"link":"/staff/onboardstaff","deprecated":false},{"title":"/api/v1/staff/{staffId}","summary":"Update a staff member","prefix":{"name":"put","color":"put"},"badges":[],"link":"/staff/updatestaff","deprecated":false},{"title":"/api/v1/staff/type/batch/create","summary":"Create staff types in batch","prefix":{"name":"post","color":"post"},"badges":[],"link":"/staff/stafftypebatchcreate","deprecated":false},{"title":"/api/v1/staff/type/batch/lookup","summary":"Lookup staff types (paged)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/staff/stafftypebatchlookup","deprecated":false}]}]}]}]}},{"type":"group","label":"Department","link":"/bundle/department","routeSlug":"/bundle/department","items":[{"label":"List departments","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/department/getdepartmentspaginated","routeSlug":"/bundle/department/getdepartmentspaginated","metadata":{"seo":{"title":"List departments","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Department"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getDepartmentsPaginated","name":"List departments","isWebhook":false,"pointer":"/paths/~1gql~1v1~1departments/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List departments","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/department"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Department"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all departments with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1departments/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1departments/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1departments/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/departments","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1departments/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/departments","href":"department/getdepartmentspaginated","openApiOperationId":"getDepartmentsPaginated","summary":"List departments","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1departments/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1departments/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved departments","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_109","exampleIds":["paths/~1gql~1v1~1departments/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_109","exampleIds":["paths/~1gql~1v1~1departments/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1departments/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_109","exampleIds":["paths/~1gql~1v1~1departments/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_109","exampleIds":["paths/~1gql~1v1~1departments/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/department/getdepartmentspaginated"}],"panels":[]}]},"httpPath":"/gql/v1/departments"}],"content":{"contentType":"group","meta":{"name":"Department"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Department","showPageActions":true},{"nodeType":"markdoc","content":"Manage departments and organizational units."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/departments","summary":"List departments","prefix":{"name":"post","color":"post"},"badges":[],"link":"/department/getdepartmentspaginated","deprecated":false}]}]}]}]}},{"type":"group","label":"Office","link":"/bundle/office","routeSlug":"/bundle/office","items":[{"label":"List offices","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/office/getofficespaginated","routeSlug":"/bundle/office/getofficespaginated","metadata":{"seo":{"title":"List offices","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Office"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getOfficesPaginated","name":"List offices","isWebhook":false,"pointer":"/paths/~1gql~1v1~1offices/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List offices","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/office"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Office"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all offices with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1offices/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1offices/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1offices/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/offices","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1offices/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/offices","href":"office/getofficespaginated","openApiOperationId":"getOfficesPaginated","summary":"List offices","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1offices/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1offices/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved offices","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_110","exampleIds":["paths/~1gql~1v1~1offices/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_110","exampleIds":["paths/~1gql~1v1~1offices/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1offices/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_110","exampleIds":["paths/~1gql~1v1~1offices/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_110","exampleIds":["paths/~1gql~1v1~1offices/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/office/getofficespaginated"}],"panels":[]}]},"httpPath":"/gql/v1/offices"}],"content":{"contentType":"group","meta":{"name":"Office"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Office","showPageActions":true},{"nodeType":"markdoc","content":"Manage office locations."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/offices","summary":"List offices","prefix":{"name":"post","color":"post"},"badges":[],"link":"/office/getofficespaginated","deprecated":false}]}]}]}]}},{"type":"group","label":"Org","link":"/bundle/org","routeSlug":"/bundle/org","items":[{"label":"List orgs","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/org/getorgspaginated","routeSlug":"/bundle/org/getorgspaginated","metadata":{"seo":{"title":"List orgs","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Organization"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getOrgsPaginated","name":"List orgs","isWebhook":false,"pointer":"/paths/~1gql~1v1~1orgs/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List orgs","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/organization"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Organization"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all orgs with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1orgs/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1orgs/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1orgs/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/orgs","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1orgs/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/orgs","href":"org/getorgspaginated","openApiOperationId":"getOrgsPaginated","summary":"List orgs","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1orgs/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1orgs/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved orgs","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_111","exampleIds":["paths/~1gql~1v1~1orgs/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_111","exampleIds":["paths/~1gql~1v1~1orgs/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1orgs/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_111","exampleIds":["paths/~1gql~1v1~1orgs/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_111","exampleIds":["paths/~1gql~1v1~1orgs/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/org/getorgspaginated"}],"panels":[]}]},"httpPath":"/gql/v1/orgs"}],"content":{"contentType":"group","meta":{"name":"Org"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Org","showPageActions":true},{"nodeType":"markdoc","content":"Manage organizations."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/orgs","summary":"List orgs","prefix":{"name":"post","color":"post"},"badges":[],"link":"/org/getorgspaginated","deprecated":false}]}]}]}]}},{"type":"group","label":"Industry","link":"/bundle/industry","routeSlug":"/bundle/industry","items":[{"label":"List industries","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/industry/getindustriespaginated","routeSlug":"/bundle/industry/getindustriespaginated","metadata":{"seo":{"title":"List industries","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Industry"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getIndustriesPaginated","name":"List industries","isWebhook":false,"pointer":"/paths/~1gql~1v1~1industries/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List industries","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/industry"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Industry"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all industries with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1industries/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1industries/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1industries/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/industries","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1industries/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/industries","href":"industry/getindustriespaginated","openApiOperationId":"getIndustriesPaginated","summary":"List industries","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1industries/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1industries/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved industries","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_112","exampleIds":["paths/~1gql~1v1~1industries/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_112","exampleIds":["paths/~1gql~1v1~1industries/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1industries/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_112","exampleIds":["paths/~1gql~1v1~1industries/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_112","exampleIds":["paths/~1gql~1v1~1industries/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/industry/getindustriespaginated"}],"panels":[]}]},"httpPath":"/gql/v1/industries"}],"content":{"contentType":"group","meta":{"name":"Industry"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Industry","showPageActions":true},{"nodeType":"markdoc","content":"Manage industry classifications."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/industries","summary":"List industries","prefix":{"name":"post","color":"post"},"badges":[],"link":"/industry/getindustriespaginated","deprecated":false}]}]}]}]}},{"type":"group","label":"Service line","link":"/bundle/service-line","routeSlug":"/bundle/service-line","items":[{"label":"List service lines","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/service-line/getservicelinespaginated","routeSlug":"/bundle/service-line/getservicelinespaginated","metadata":{"seo":{"title":"List service lines","description":"🔐 Required role: API_ADMIN📖 Data dictionary: Service line"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getServiceLinesPaginated","name":"List service lines","isWebhook":false,"pointer":"/paths/~1gql~1v1~1service_lines/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List service lines","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/service-line"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Service line"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all service lines with basic pagination support"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Uses standard limit/offset pagination via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to detect the end."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is a read-only lookup endpoint backed by Hasura."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unlike the other lookups, item keys are snake_case ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"created_at"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"updated_at"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", …)."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":false,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1service_lines/post/requestBody/content/application~1json/examples/default_pagination"]}},"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1service_lines/post/requestBody/content/application~1json/examples/default_pagination"],"pointer":"/paths/~1gql~1v1~1service_lines/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/gql/v1/service_lines","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1service_lines/post/requestBody/content/application~1json/examples/default_pagination"]}},"responseCodes":["200","400","401","500"],"pointer":"/gql/v1/service_lines","href":"service-line/getservicelinespaginated","openApiOperationId":"getServiceLinesPaginated","summary":"List service lines","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1service_lines/post/requestBody/content/application~1json/examples/default_pagination"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_17","exampleIds":["paths/~1gql~1v1~1service_lines/post/requestBody/content/application~1json/examples/default_pagination"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Successfully retrieved service lines","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_113","exampleIds":["paths/~1gql~1v1~1service_lines/post/responses/200/content/application~1json/examples/sample"]}},"schemaId":"schema_113","exampleIds":["paths/~1gql~1v1~1service_lines/post/responses/200/content/application~1json/examples/sample"]},{"code":"400","description":"Bad request - invalid pagination parameters"},{"code":"401","description":"Unauthorized"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1gql~1v1~1service_lines/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_113","exampleIds":["paths/~1gql~1v1~1service_lines/post/responses/200/content/application~1json/examples/sample"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_113","exampleIds":["paths/~1gql~1v1~1service_lines/post/responses/200/content/application~1json/examples/sample"]}}},{"code":"400"},{"code":"401"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/service-line/getservicelinespaginated"}],"panels":[]}]},"httpPath":"/gql/v1/service_lines"}],"content":{"contentType":"group","meta":{"name":"Service Line"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Service line","showPageActions":true},{"nodeType":"markdoc","content":"Manage service line classifications."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/gql/v1/service_lines","summary":"List service lines","prefix":{"name":"post","color":"post"},"badges":[],"link":"/service-line/getservicelinespaginated","deprecated":false}]}]}]}]}},{"type":"separator","label":"Records & files","content":null},{"type":"group","label":"Records","link":"/bundle/records","routeSlug":"/bundle/records","items":[{"label":"Create or update records (upsert)","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/createorupdaterecords","routeSlug":"/bundle/records/createorupdaterecords","metadata":{"seo":{"title":"Create or update records (upsert)","description":"🔐 Required role: RECD_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"createOrUpdateRecords","name":"Create or update records (upsert)","isWebhook":false,"pointer":"/paths/~1api~1v1~1records/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create or update records (upsert)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create or update records (upsert)"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records are created if they don't exist, or updated if matched by systemRef."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Partial Success Behavior:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record is processed independently"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Successful records are persisted even if others fail"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Check "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"summary.failed"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and individual "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"records[].status"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for failures"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Failed records include error details in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"records[].error"},"children":[],"type":"code"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Read-only and hidden custom fields:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values sent for them are ignored and the stored values are kept."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limits:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Bulk record import"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entity synchronization"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1records/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/records","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/records","href":"records/createorupdaterecords","openApiOperationId":"createOrUpdateRecords","summary":"Create or update records (upsert)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Records processed successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires RECD_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/createorupdaterecords"}],"panels":[]}]},"httpPath":"/api/v1/records"},{"label":"Update records (fails if not found)","deprecated":false,"httpVerb":"put","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/updaterecords","routeSlug":"/bundle/records/updaterecords","metadata":{"seo":{"title":"Update records (fails if not found)","description":"🔐 Required role: RECD_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"updateRecords","name":"Update records (fails if not found)","isWebhook":false,"pointer":"/paths/~1api~1v1~1records/put","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Update records (fails if not found)","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Update existing records only"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Only updates existing records. A record whose systemRef is not found is reported as"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"failed inside the 200 response; the request itself does not answer 404."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The systemRef field is required for all records in PUT requests."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Partial Success Behavior:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record is processed independently"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Successful records are persisted even if others fail"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records not found will have status "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"FAILED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with error code "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECORD_NOT_FOUND"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Check "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"summary.failed"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and individual "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"records[].status"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for failures"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Read-only and hidden custom fields:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values sent for them are ignored and the stored values are kept."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limits:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Strict update workflows"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Guaranteed existence updates"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/put/requestBody/content/application~1json/example"]}},"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/put/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1records/put/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"PUT","path":"/api/v1/records","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/put/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/records","href":"records/updaterecords","openApiOperationId":"updateRecords","summary":"Update records (fails if not found)","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/put/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_90","exampleIds":["paths/~1api~1v1~1records/put/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Records updated successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires RECD_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Records not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records/put/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/updaterecords"}],"panels":[]}]},"httpPath":"/api/v1/records"},{"label":"Delete (inactivate) records","deprecated":false,"httpVerb":"delete","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/deleterecords","routeSlug":"/bundle/records/deleterecords","metadata":{"seo":{"title":"Delete (inactivate) records","description":"🔐 Required role: RECD_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"deleteRecords","name":"Delete (inactivate) records","isWebhook":false,"pointer":"/paths/~1api~1v1~1records/delete","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Delete (inactivate) records","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Delete (inactivate) records"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Soft-deletes records by marking them as inactive. A record that is not found is reported"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"as failed inside the 200 response; the request itself does not answer 404."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The systemRef field is required for all records in DELETE requests."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Partial Success Behavior:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Each record is processed independently"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Successful deletions are persisted even if others fail"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records not found will have status "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"FAILED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with error code "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECORD_NOT_FOUND"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Check "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"summary.failed"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and individual "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"records[].status"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for failures"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limits:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Maximum 100 records per request."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Bulk inactivation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Record cleanup"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_114","exampleIds":["paths/~1api~1v1~1records/delete/requestBody/content/application~1json/example"]}},"schemaId":"schema_114","exampleIds":["paths/~1api~1v1~1records/delete/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1records/delete/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"DELETE","path":"/api/v1/records","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_114","exampleIds":["paths/~1api~1v1~1records/delete/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/records","href":"records/deleterecords","openApiOperationId":"deleteRecords","summary":"Delete (inactivate) records","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_114","exampleIds":["paths/~1api~1v1~1records/delete/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_114","exampleIds":["paths/~1api~1v1~1records/delete/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Records deleted successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}},"schemaId":"schema_91"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires RECD_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Records not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records/delete/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_91","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_91"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/deleterecords"}],"panels":[]}]},"httpPath":"/api/v1/records"},{"label":"List available record types","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/listentitytypes","routeSlug":"/bundle/records/listentitytypes","metadata":{"seo":{"title":"List available record types","description":"🔐 Required role: RECD_R or RECD_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"listEntityTypes","name":"List available record types","isWebhook":false,"pointer":"/paths/~1api~1v1~1records~1types/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List available record types","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"List available record types"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns record types that can be managed via this API, with schema URLs."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Discover record types"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/records/types","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/records/types","href":"records/listentitytypes","openApiOperationId":"listEntityTypes","summary":"List available record types","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Entity types retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_88"}},"schemaId":"schema_88"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of RECD_R, RECD_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records~1types/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_88","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_88"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/listentitytypes"}],"panels":[]}]},"httpPath":"/api/v1/records/types"},{"label":"Get field schema for a record type","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/getentityschema","routeSlug":"/bundle/records/getentityschema","metadata":{"seo":{"title":"Get field schema for a record type","description":"🔐 Required role: RECD_R or RECD_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getEntitySchema","name":"Get field schema for a record type","isWebhook":false,"pointer":"/paths/~1api~1v1~1records~1schema~1{type}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get field schema for a record type","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RECD_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get field schema for a record type"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns field definitions including types, validation, and foreign key relationships."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Dynamic form generation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Field validation"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration mapping"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"type","in":"path","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Record type name, built-in or custom, as listed by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/records/types"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1api~1v1~1records~1schema~1{type}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/records/schema/{type}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"type","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/records/schema/{type}","href":"records/getentityschema","openApiOperationId":"getEntitySchema","summary":"Get field schema for a record type","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Schema retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_89"}},"schemaId":"schema_89"},{"code":"400","description":"Invalid record type"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of RECD_R, RECD_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records~1schema~1{type}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_89","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_89"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/getentityschema"}],"panels":[]}]},"httpPath":"/api/v1/records/schema/{type}"},{"label":"List all custom record types","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/listcustomrecordtypes","routeSlug":"/bundle/records/listcustomrecordtypes","metadata":{"seo":{"title":"List all custom record types","description":"🔐 Required role: CUSTYP_R or CUSTYP_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"listCustomRecordTypes","name":"List all custom record types","isWebhook":false,"pointer":"/paths/~1api~1v1~1records~1custom/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List all custom record types","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CUSTYP_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CUSTYP_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"List all custom record types"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns all custom record type definitions for the tenant."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Query parameter:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"includeInactive"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (boolean, optional, default "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). Send"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"?includeInactive=true"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to include deactivated record types."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Discover custom record types"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration configuration"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"includeInactive","in":"query","schemaId":"schema_115"}],"pointer":"/paths/~1api~1v1~1records~1custom/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/records/custom","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[{"name":"includeInactive","in":"query","required":false,"schemaId":"schema_115"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/records/custom","href":"records/listcustomrecordtypes","openApiOperationId":"listCustomRecordTypes","summary":"List all custom record types","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Record types retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_116"}},"schemaId":"schema_116"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of CUSTYP_R, CUSTYP_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records~1custom/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_116","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_116"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/listcustomrecordtypes"}],"panels":[]}]},"httpPath":"/api/v1/records/custom"},{"label":"Create a new custom record type","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/createcustomrecordtype","routeSlug":"/bundle/records/createcustomrecordtype","metadata":{"seo":{"title":"Create a new custom record type","description":"🔐 Required role: CUSTYP_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"createCustomRecordType","name":"Create a new custom record type","isWebhook":false,"pointer":"/paths/~1api~1v1~1records~1custom/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create a new custom record type","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CUSTYP_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create a new custom record type"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Creates a new custom record type with the specified field schema."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The record type name must be unique and follow naming conventions."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A name that already exists (custom or built-in, e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") answers "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"409"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":":"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n  \"error\": { \"code\": \"ERROR\", \"message\": \"Entity type 'Client' already exists\" },\n  \"meta\": { \"success\": false, \"timestamp\": \"2026-10-01T12:00:00Z\", \"version\": \"v1\" }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n  \"error\": { \"code\": \"ERROR\", \"message\": \"Entity type 'Client' already exists\" },\n  \"meta\": { \"success\": false, \"timestamp\": \"2026-10-01T12:00:00Z\", \"version\": \"v1\" }\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Define custom data structures"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Extend system capabilities"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_117"}},"schemaId":"schema_117","pointer":"/paths/~1api~1v1~1records~1custom/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/records/custom","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_117"}},"responseCodes":["201","400","401","403","409","500"],"pointer":"/api/v1/records/custom","href":"records/createcustomrecordtype","openApiOperationId":"createCustomRecordType","summary":"Create a new custom record type","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_117","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_117"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"201","description":"Record type created successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}},"schemaId":"schema_118"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires CUSTYP_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"409","description":"A record type with this name already exists"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records~1custom/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"201","schemaId":"schema_118","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"409"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/createcustomrecordtype"}],"panels":[]}]},"httpPath":"/api/v1/records/custom"},{"label":"Get a custom record type by name","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/getcustomrecordtype","routeSlug":"/bundle/records/getcustomrecordtype","metadata":{"seo":{"title":"Get a custom record type by name","description":"🔐 Required role: CUSTYP_R or CUSTYP_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getCustomRecordType","name":"Get a custom record type by name","isWebhook":false,"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get a custom record type by name","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CUSTYP_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CUSTYP_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get a custom record type by name"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the full definition of a custom record type including its field schema."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A name that is unknown, or that names a built-in (non-custom) record type, answers 404."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"View record type schema"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration setup"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"name","in":"path","schemaId":"schema_65","description":"Name of the custom record type.","required":true}],"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/records/custom/{name}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"name","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/records/custom/{name}","href":"records/getcustomrecordtype","openApiOperationId":"getCustomRecordType","summary":"Get a custom record type by name","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Record type retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}},"schemaId":"schema_118"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires any of CUSTYP_R, CUSTYP_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Record type not found, or the name is a built-in (non-custom) record type"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_118","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/getcustomrecordtype"}],"panels":[]}]},"httpPath":"/api/v1/records/custom/{name}"},{"label":"Update a custom record type","deprecated":false,"httpVerb":"put","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/updatecustomrecordtype","routeSlug":"/bundle/records/updatecustomrecordtype","metadata":{"seo":{"title":"Update a custom record type","description":"🔐 Required role: CUSTYP_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"updateCustomRecordType","name":"Update a custom record type","isWebhook":false,"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/put","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Update a custom record type","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CUSTYP_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Update a custom record type"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Updates an existing custom record type. Only provided fields will be updated."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note: Changing fields may affect existing data."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"description"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" can be changed on its own; omit "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fields"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to keep the current field definitions. A type stored without field definitions needs "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fields"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" sent with it (400 otherwise). Field names already on the type are kept as they are, even if they are not snake_case."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Modify record type definitions"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Add new fields"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"name","in":"path","schemaId":"schema_65","description":"Name of the custom record type.","required":true}],"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/put/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_119"}},"schemaId":"schema_119","pointer":"/paths/~1api~1v1~1records~1custom~1{name}/put/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"PUT","path":"/api/v1/records/custom/{name}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"name","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_119"}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/records/custom/{name}","href":"records/updatecustomrecordtype","openApiOperationId":"updateCustomRecordType","summary":"Update a custom record type","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_119","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_119"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Record type updated successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}},"schemaId":"schema_118"},{"code":"400","description":"Invalid request data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires CUSTYP_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Record type not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/put/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_118","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/updatecustomrecordtype"}],"panels":[]}]},"httpPath":"/api/v1/records/custom/{name}"},{"label":"Deactivate a custom record type","deprecated":false,"httpVerb":"delete","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/records/deactivatecustomrecordtype","routeSlug":"/bundle/records/deactivatecustomrecordtype","metadata":{"seo":{"title":"Deactivate a custom record type","description":"🔐 Required role: CUSTYP_C📖 Data dictionary: Records and custom record types"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"deactivateCustomRecordType","name":"Deactivate a custom record type","isWebhook":false,"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/delete","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Deactivate a custom record type","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CUSTYP_C"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/custom-record"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Records and custom record types"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Deactivate a custom record type"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Soft-deletes a custom record type by marking it as inactive."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Existing data is preserved but the type will no longer appear in lists."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Remove custom record types"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Clean up unused definitions"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"name","in":"path","schemaId":"schema_65","description":"Name of the custom record type.","required":true}],"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/delete/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"DELETE","path":"/api/v1/records/custom/{name}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"name","in":"path","required":true,"schemaId":"schema_65"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","401","403","404","500"],"pointer":"/api/v1/records/custom/{name}","href":"records/deactivatecustomrecordtype","openApiOperationId":"deactivateCustomRecordType","summary":"Deactivate a custom record type","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Record type deactivated successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}},"schemaId":"schema_118"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires CUSTYP_C)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Record type not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1records~1custom~1{name}/delete/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_118","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_118"}}},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/records/deactivatecustomrecordtype"}],"panels":[]}]},"httpPath":"/api/v1/records/custom/{name}"}],"content":{"contentType":"group","meta":{"name":"Records"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Records","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create, update, and manage entity records across standard and custom record types."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The Records API provides:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Record operations"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Create, update, and delete records for any entity type"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Schema discovery"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Query available entity types and their field definitions"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Custom record types"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Define and manage custom record type schemas"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v1/records","summary":"Create or update records (upsert)","prefix":{"name":"post","color":"post"},"badges":[],"link":"/records/createorupdaterecords","deprecated":false},{"title":"/api/v1/records","summary":"Update records (fails if not found)","prefix":{"name":"put","color":"put"},"badges":[],"link":"/records/updaterecords","deprecated":false},{"title":"/api/v1/records","summary":"Delete (inactivate) records","prefix":{"name":"delete","color":"delete"},"badges":[],"link":"/records/deleterecords","deprecated":false},{"title":"/api/v1/records/types","summary":"List available record types","prefix":{"name":"get","color":"get"},"badges":[],"link":"/records/listentitytypes","deprecated":false},{"title":"/api/v1/records/schema/{type}","summary":"Get field schema for a record type","prefix":{"name":"get","color":"get"},"badges":[],"link":"/records/getentityschema","deprecated":false},{"title":"/api/v1/records/custom","summary":"List all custom record types","prefix":{"name":"get","color":"get"},"badges":[],"link":"/records/listcustomrecordtypes","deprecated":false},{"title":"/api/v1/records/custom","summary":"Create a new custom record type","prefix":{"name":"post","color":"post"},"badges":[],"link":"/records/createcustomrecordtype","deprecated":false},{"title":"/api/v1/records/custom/{name}","summary":"Get a custom record type by name","prefix":{"name":"get","color":"get"},"badges":[],"link":"/records/getcustomrecordtype","deprecated":false},{"title":"/api/v1/records/custom/{name}","summary":"Update a custom record type","prefix":{"name":"put","color":"put"},"badges":[],"link":"/records/updatecustomrecordtype","deprecated":false},{"title":"/api/v1/records/custom/{name}","summary":"Deactivate a custom record type","prefix":{"name":"delete","color":"delete"},"badges":[],"link":"/records/deactivatecustomrecordtype","deprecated":false}]}]}]}]}},{"type":"group","label":"File","link":"/bundle/file","routeSlug":"/bundle/file","items":[{"label":"List files with filters and cursor pagination","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/file/listfiles","routeSlug":"/bundle/file/listfiles","metadata":{"seo":{"title":"List files with filters and cursor pagination","description":"🔐 Required role: API_ADMIN📖 Data dictionary: File"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"listFiles","name":"List files with filters and cursor pagination","isWebhook":false,"pointer":"/paths/~1api~1v1~1files/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List files with filters and cursor pagination","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/file"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"File"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve a paginated list of files scoped to the tenant"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns files across whitelisted sources: CLIENT_REQUEST, DELIVERABLE, REFERENCE_FILE, DMS_DIRECT_UPLOAD."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Optional Filters:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdAfter"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (ISO-8601) — only files created strictly after this timestamp"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdBefore"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (ISO-8601) — only files created strictly before this timestamp"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — filter by numeric client ID"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — filter by project/job ID"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ids"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — filter by one or more specific file IDs (multi-value: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"?ids=1&ids=2"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pagination:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Results ordered by creation time, then id, oldest first"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pass "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"nextCursor"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" from a previous response as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"cursor"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to fetch the next page"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" defaults to 20, max 100 (larger values are capped at 100)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ items, nextCursor, hasMore }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"nextCursor"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is null when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"hasMore"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is false."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Fields per item"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (camelCase):"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (string), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"name"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (always true: only active files are listed), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (ISO-8601),"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"updatedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (ISO-8601, nullable), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"sizeBytes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (nullable), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"path"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (slash-joined folder names)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"downloadUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"downloadUrlExpiresAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — time-limited direct-link URL and its expiry; null unless "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"includeDownloadUrl=true"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the file has a DMS path or external ID. Omit this flag for metadata-only queries (pagination, search) to avoid unnecessary URL minting on every page."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"context"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ clientId, clientName, projectId, projectName, uploadedBy }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", each nullable"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Invalid date formats or an invalid "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"cursor"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" return 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve all files associated with a client or project"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Paginate through large file sets using cursor pagination"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Filter files by upload date range"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Fetch specific files by ID"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"createdAfter","in":"query","schemaId":"schema_65"},{"name":"createdBefore","in":"query","schemaId":"schema_65"},{"name":"clientId","in":"query","schemaId":"schema_65"},{"name":"clientKey","in":"query","schemaId":"schema_65"},{"name":"projectId","in":"query","schemaId":"schema_65"},{"name":"ids","in":"query","style":"form","explode":true,"schemaId":"schema_120"},{"name":"cursor","in":"query","schemaId":"schema_65"},{"name":"pageSize","in":"query","schemaId":"schema_121"},{"name":"includeDownloadUrl","in":"query","schemaId":"schema_115"}],"pointer":"/paths/~1api~1v1~1files/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/files","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[{"name":"createdAfter","in":"query","required":false,"schemaId":"schema_65"},{"name":"createdBefore","in":"query","required":false,"schemaId":"schema_65"},{"name":"clientId","in":"query","required":false,"schemaId":"schema_65"},{"name":"clientKey","in":"query","required":false,"schemaId":"schema_65"},{"name":"projectId","in":"query","required":false,"schemaId":"schema_65"},{"name":"ids","in":"query","required":false,"schemaId":"schema_120","style":"form","explode":true},{"name":"cursor","in":"query","required":false,"schemaId":"schema_65"},{"name":"pageSize","in":"query","required":false,"schemaId":"schema_121"},{"name":"includeDownloadUrl","in":"query","required":false,"schemaId":"schema_115"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/files","href":"file/listfiles","openApiOperationId":"listFiles","summary":"List files with filters and cursor pagination","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Files retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_122"}},"schemaId":"schema_122"},{"code":"400","description":"Invalid request parameters"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires API_ADMIN)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1files/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_122","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_122"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/file/listfiles"}],"panels":[]}]},"httpPath":"/api/v1/files"},{"label":"Get file metadata by ID","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/file/getfilebyid","routeSlug":"/bundle/file/getfilebyid","metadata":{"seo":{"title":"Get file metadata by ID","description":"🔐 Required role: API_ADMIN📖 Data dictionary: File"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getFileById","name":"Get file metadata by ID","isWebhook":false,"pointer":"/paths/~1api~1v1~1files~1{id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get file metadata by ID","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"API_ADMIN"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/file"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"File"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A key issued in the Firm Portal also needs "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"FILE_R"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"includeDownloadUrl=true"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; without it the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"call returns "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"403"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve file metadata by Aiwyn ID"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns file metadata including filename, source type, status, and optional download URL."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Query Parameters:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"includeDownloadUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (optional, default: false) - When true, generates a time-limited signed download URL"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the file:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (number; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/files"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns the same id as a string), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"filename"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fileSource"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fileStatus"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (nullable), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"updatedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"externalDmsFileId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (nullable)"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"fileInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (nullable) — "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ id, size, createdByStaffId, createdByContactId, createdAt, updatedAt }"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"downloadUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — signed download URL, present only when includeDownloadUrl=true and the file has a GCS path"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Download URLs are time-limited (15 minutes) and should be used promptly."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve file metadata for display"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Generate download URLs for file access"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Verify file existence and status"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":"File id.","required":true}],"pointer":"/paths/~1api~1v1~1files~1{id}/get/parameters"},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"includeDownloadUrl","in":"query","schemaId":"schema_115"}],"pointer":"/paths/~1api~1v1~1files~1{id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/files/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[{"name":"includeDownloadUrl","in":"query","required":false,"schemaId":"schema_115"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/files/{id}","href":"file/getfilebyid","openApiOperationId":"getFileById","summary":"Get file metadata by ID","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"File retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_123"}},"schemaId":"schema_123"},{"code":"400","description":"Invalid request"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires API_ADMIN)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"File not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1files~1{id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_123","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_123"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/file/getfilebyid"}],"panels":[]}]},"httpPath":"/api/v1/files/{id}"}],"content":{"contentType":"group","meta":{"name":"File"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"File","showPageActions":true},{"nodeType":"markdoc","content":"Download and access files associated with records and documents."}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v1/files","summary":"List files with filters and cursor pagination","prefix":{"name":"get","color":"get"},"badges":[],"link":"/file/listfiles","deprecated":false},{"title":"/api/v1/files/{id}","summary":"Get file metadata by ID","prefix":{"name":"get","color":"get"},"badges":[],"link":"/file/getfilebyid","deprecated":false}]}]}]}]}},{"type":"separator","label":"Webhooks","content":null},{"type":"group","label":"Event subscriptions","link":"/bundle/event-subscriptions","routeSlug":"/bundle/event-subscriptions","items":[{"label":"Get available event types catalog","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/geteventsettingscatalog","routeSlug":"/bundle/event-subscriptions/geteventsettingscatalog","metadata":{"seo":{"title":"Get available event types catalog","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getEventSettingsCatalog","name":"Get available event types catalog","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions~1catalog/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get available event types catalog","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get catalog of available event types"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns all entity/operation combinations that can be subscribed to."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Use the 'enabled' query parameter to filter by enabled status."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Discover available events"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Integration planning"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/event-subscriptions/catalog","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/event-subscriptions/catalog","href":"event-subscriptions/geteventsettingscatalog","openApiOperationId":"getEventSettingsCatalog","summary":"Get available event types catalog","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The catalog entries, in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_124"}},"schemaId":"schema_124"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - the request is refused for the token's tenant (see the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header rule in the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"security section). The catalog needs no Product API role: any valid bearer token can read it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1catalog/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_124","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_124"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/geteventsettingscatalog"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions/catalog"},{"label":"Create a webhook subscription","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/createeventsubscription","routeSlug":"/bundle/event-subscriptions/createeventsubscription","metadata":{"seo":{"title":"Create a webhook subscription","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"createEventSubscription","name":"Create a webhook subscription","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Create a webhook subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create a webhook subscription for entity events"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Subscribe to receive webhook notifications when entities are created, updated, or deleted."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The webhook URL must use HTTPS and will receive POST requests with event data."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Real-time integrations"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event-driven workflows"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"System synchronization"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_125","exampleIds":["paths/~1api~1v1~1event-subscriptions/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_125","exampleIds":["paths/~1api~1v1~1event-subscriptions/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1event-subscriptions/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/event-subscriptions","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_125","exampleIds":["paths/~1api~1v1~1event-subscriptions/post/requestBody/content/application~1json/example"]}},"responseCodes":["201","400","401","403","500"],"pointer":"/api/v1/event-subscriptions","href":"event-subscriptions/createeventsubscription","openApiOperationId":"createEventSubscription","summary":"Create a webhook subscription","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_125","exampleIds":["paths/~1api~1v1~1event-subscriptions/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_125","exampleIds":["paths/~1api~1v1~1event-subscriptions/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"201","description":"Event Subscriptions created successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_126"}},"schemaId":"schema_126"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires EVNT_SUB)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"201","schemaId":"schema_126","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_126"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/createeventsubscription"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions"},{"label":"List the caller's webhook subscriptions","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/listeventsubscriptions","routeSlug":"/bundle/event-subscriptions/listeventsubscriptions","metadata":{"seo":{"title":"List the caller's webhook subscriptions","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"listEventSubscriptions","name":"List the caller's webhook subscriptions","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"List the caller's webhook subscriptions","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"List the caller's webhook subscriptions"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns the caller's subscriptions, active and deactivated, one page at a time. The signing secret is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"never included."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Query Parameters (all optional):"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"entityType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — only subscriptions for this entity (a catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entity"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value, e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RequestItem"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — only subscriptions for this operation (a catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value, e.g. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"SENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — zero-based page number and page size; see"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#webhook-subscriptions-and-delivery-history"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Webhook subscriptions and delivery history"},"children":[],"type":"text"}],"type":"link"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a page whose "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"content"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" items have the same fields as the subscription"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returned by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PATCH /api/v1/event-subscriptions/{id}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Find subscription ids to update or deactivate"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Audit webhook integrations"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"entityType","in":"query","schemaId":"schema_65"},{"name":"operation","in":"query","schemaId":"schema_65"},{"name":"page","in":"query","schemaId":"schema_127"},{"name":"limit","in":"query","schemaId":"schema_128"}],"pointer":"/paths/~1api~1v1~1event-subscriptions/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/event-subscriptions","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[{"name":"entityType","in":"query","required":false,"schemaId":"schema_65"},{"name":"operation","in":"query","required":false,"schemaId":"schema_65"},{"name":"page","in":"query","required":false,"schemaId":"schema_127"},{"name":"limit","in":"query","required":false,"schemaId":"schema_128"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/event-subscriptions","href":"event-subscriptions/listeventsubscriptions","openApiOperationId":"listEventSubscriptions","summary":"List the caller's webhook subscriptions","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Subscriptions retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_129"}},"schemaId":"schema_129"},{"code":"400","description":"Invalid query parameters"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires EVNT_SUB)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_129","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_129"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/listeventsubscriptions"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions"},{"label":"Update a webhook subscription","deprecated":false,"httpVerb":"patch","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/updateeventsubscription","routeSlug":"/bundle/event-subscriptions/updateeventsubscription","metadata":{"seo":{"title":"Update a webhook subscription","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"updateEventSubscription","name":"Update a webhook subscription","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}/patch","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Update a webhook subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Update an existing webhook subscription"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Modify subscription properties such as delivery URL, filter expression, or description."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Only provided fields will be updated."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Update webhook URLs"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Modify event filters"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":"Event subscription id.","required":true,"example":9}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}/patch/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_130"}},"schemaId":"schema_130","pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}/patch/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"PATCH","path":"/api/v1/event-subscriptions/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":9,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_130"}},"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/event-subscriptions/{id}","href":"event-subscriptions/updateeventsubscription","openApiOperationId":"updateEventSubscription","summary":"Update a webhook subscription","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_130","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_130"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Event Subscriptions updated successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_131"}},"schemaId":"schema_131"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires EVNT_SUB)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No subscription with this id belongs to the caller.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_132"}},"schemaId":"schema_132"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}/patch/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_131","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_131"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404","schemaId":"schema_132","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_132"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/updateeventsubscription"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions/{id}"},{"label":"Deactivate a webhook subscription","deprecated":false,"httpVerb":"delete","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/deactivateeventsubscription","routeSlug":"/bundle/event-subscriptions/deactivateeventsubscription","metadata":{"seo":{"title":"Deactivate a webhook subscription","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"deactivateEventSubscription","name":"Deactivate a webhook subscription","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}/delete","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Deactivate a webhook subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Deactivate a webhook subscription"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Soft-deletes a subscription by marking it as inactive."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The subscription can be reactivated later if needed."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Stop receiving webhooks"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cleanup unused subscriptions"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":"Event subscription id.","required":true,"example":9}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}/delete/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"DELETE","path":"/api/v1/event-subscriptions/{id}","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"example":9,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","401","403","404","500"],"pointer":"/api/v1/event-subscriptions/{id}","href":"event-subscriptions/deactivateeventsubscription","openApiOperationId":"deactivateEventSubscription","summary":"Deactivate a webhook subscription","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The subscription is deactivated ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" becomes false). The body is an empty "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" object with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"meta"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_133"}},"schemaId":"schema_133"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires EVNT_SUB)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"No active subscription with this id belongs to the caller (unknown id or already deactivated).","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_134"}},"schemaId":"schema_134"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}/delete/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_133","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_133"}}},{"code":"401"},{"code":"403"},{"code":"404","schemaId":"schema_134","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_134"}}},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/deactivateeventsubscription"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions/{id}"},{"label":"Reactivate a webhook subscription","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/reactivateeventsubscription","routeSlug":"/bundle/event-subscriptions/reactivateeventsubscription","metadata":{"seo":{"title":"Reactivate a webhook subscription","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"reactivateEventSubscription","name":"Reactivate a webhook subscription","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}~1reactivate/post","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Reactivate a webhook subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reactivate a webhook subscription"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reactivates a previously deactivated subscription."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Restore webhook integrations"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Resume event notifications"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":"Event subscription id.","required":true}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}~1reactivate/post/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/event-subscriptions/{id}/reactivate","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/event-subscriptions/{id}/reactivate","href":"event-subscriptions/reactivateeventsubscription","openApiOperationId":"reactivateEventSubscription","summary":"Reactivate a webhook subscription","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Subscription reactivated successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_135"}},"schemaId":"schema_135"},{"code":"400","description":"Subscription filter no longer allowed"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires EVNT_SUB)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Subscription not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}~1reactivate/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_135","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_135"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/reactivateeventsubscription"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions/{id}/reactivate"},{"label":"Retrieve webhook delivery attempts for a subscription","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/getwebhookdeliveryhistory","routeSlug":"/bundle/event-subscriptions/getwebhookdeliveryhistory","metadata":{"seo":{"title":"Retrieve webhook delivery attempts for a subscription","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getWebhookDeliveryHistory","name":"Retrieve webhook delivery attempts for a subscription","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}~1deliveries/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Retrieve webhook delivery attempts for a subscription","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieve webhook delivery attempts for a subscription"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Returns a paginated list of delivery attempts for webhook events for the given subscription."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Supports filtering by HTTP status code and time range."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Query Parameters (all optional):"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"statusCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — only attempts that received this HTTP status code"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"startDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"endDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (ISO-8601 date-time) — only attempts in this time range"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — see "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/pagination#webhook-subscriptions-and-delivery-history"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"paging"},"children":[],"type":"text"}],"type":"link"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"startDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"endDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" that is not an ISO-8601 date-time returns 400."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a page; each "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"content"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" item is a delivery attempt "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{ id, eventId, attemptNumber, timestamp, statusCode, responseBody, errorMessage, deliveryUrl, deliveryTimeMs, success, createdAt }"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"statusCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"responseBody"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"errorMessage"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"deliveryTimeMs"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"createdAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" can be null."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Webhook troubleshooting"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Delivery monitoring"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operational auditing"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"id","in":"path","schemaId":"schema_95","description":"Event subscription id.","required":true}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}~1deliveries/get/parameters"},{"nodeType":"item-content","variant":"query","label":"Query","labelTranslationKey":"query","parameters":[{"name":"statusCode","in":"query","schemaId":"schema_136"},{"name":"startDate","in":"query","schemaId":"schema_137"},{"name":"endDate","in":"query","schemaId":"schema_137"},{"name":"page","in":"query","schemaId":"schema_127"},{"name":"limit","in":"query","schemaId":"schema_128"}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}~1deliveries/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/event-subscriptions/{id}/deliveries","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[{"name":"id","in":"path","required":true,"schemaId":"schema_95"}],"query":[{"name":"statusCode","in":"query","required":false,"schemaId":"schema_136"},{"name":"startDate","in":"query","required":false,"schemaId":"schema_137"},{"name":"endDate","in":"query","required":false,"schemaId":"schema_137"},{"name":"page","in":"query","required":false,"schemaId":"schema_127"},{"name":"limit","in":"query","required":false,"schemaId":"schema_128"}],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","404","500"],"pointer":"/api/v1/event-subscriptions/{id}/deliveries","href":"event-subscriptions/getwebhookdeliveryhistory","openApiOperationId":"getWebhookDeliveryHistory","summary":"Retrieve webhook delivery attempts for a subscription","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Delivery history retrieved successfully","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_138"}},"schemaId":"schema_138"},{"code":"400","description":"Invalid query parameters"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires EVNT_SUB)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"404","description":"Subscription not found"},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1{id}~1deliveries/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_138","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_138"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"404"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/getwebhookdeliveryhistory"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions/{id}/deliveries"},{"label":"Get webhook signing secret","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/getsubscriptionsecret","routeSlug":"/bundle/event-subscriptions/getsubscriptionsecret","metadata":{"seo":{"title":"Get webhook signing secret","description":"🔐 Required role: EVNT_SUB📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"getSubscriptionSecret","name":"Get webhook signing secret","isWebhook":false,"pointer":"/paths/~1api~1v1~1event-subscriptions~1webhook~1secret/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Get webhook signing secret","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EVNT_SUB"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Get the webhook signing secret"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Retrieves the secret used to sign webhook payloads."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Use this secret to verify webhook authenticity on your server."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"The caller has one secret for all of its subscriptions; it is the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"webhookSecret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returned when a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"subscription is created, and is created on the first call if the caller has none yet."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Webhook signature verification"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Security setup"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/api/v1/event-subscriptions/webhook/secret","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/event-subscriptions/webhook/secret","href":"event-subscriptions/getsubscriptionsecret","openApiOperationId":"getSubscriptionSecret","summary":"Get webhook signing secret","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The caller's webhook signing secret, in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_139"}},"schemaId":"schema_139"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires EVNT_SUB)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1event-subscriptions~1webhook~1secret/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_139","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_139"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/getsubscriptionsecret"}],"panels":[]}]},"httpPath":"/api/v1/event-subscriptions/webhook/secret"},{"label":"Generate a test webhook payload and signature","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/generatewebhooktestpayload","routeSlug":"/bundle/event-subscriptions/generatewebhooktestpayload","metadata":{"seo":{"title":"Generate a test webhook payload and signature","description":"🔐 Required role: WEBHK_TST📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"generateWebhookTestPayload","name":"Generate a test webhook payload and signature","isWebhook":false,"pointer":"/paths/~1api~1v1~1webhook~1test~1generate/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Generate a test webhook payload and signature","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"WEBHK_TST"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Generate a signed test webhook payload"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Generates a signature for an arbitrary JSON payload using the provided secret."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is intended for debugging webhook integrations ONLY."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Webhook troubleshooting"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Signature validation testing"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_140","exampleIds":["paths/~1api~1v1~1webhook~1test~1generate/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_140","exampleIds":["paths/~1api~1v1~1webhook~1test~1generate/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1webhook~1test~1generate/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/webhook/test/generate","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_140","exampleIds":["paths/~1api~1v1~1webhook~1test~1generate/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/webhook/test/generate","href":"event-subscriptions/generatewebhooktestpayload","openApiOperationId":"generateWebhookTestPayload","summary":"Generate a test webhook payload and signature","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_140","exampleIds":["paths/~1api~1v1~1webhook~1test~1generate/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_140","exampleIds":["paths/~1api~1v1~1webhook~1test~1generate/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The payload, its signature and the secret. The body is not wrapped in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"meta"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"signature"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"sha256="},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" followed by the Base64 HMAC-SHA256 of the compact JSON payload."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_141"}},"schemaId":"schema_141"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires WEBHK_TST)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1webhook~1test~1generate/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_141","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_141"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/generatewebhooktestpayload"}],"panels":[]}]},"httpPath":"/api/v1/webhook/test/generate"},{"label":"Validate a webhook signature","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/bundle/event-subscriptions/validatewebhooktestsignature","routeSlug":"/bundle/event-subscriptions/validatewebhooktestsignature","metadata":{"seo":{"title":"Validate a webhook signature","description":"🔐 Required role: WEBHK_TST📖 Data dictionary: Event subscription"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"validateWebhookTestSignature","name":"Validate a webhook signature","isWebhook":false,"pointer":"/paths/~1api~1v1~1webhook~1test~1validate/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Validate a webhook signature","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"🔐 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Required role:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"WEBHK_TST"},"children":[],"type":"code"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"📖 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Data dictionary:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/reference/data-dictionary/event-subscription"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event subscription"},"children":[],"type":"text"}],"type":"link"}],"type":"paragraph"}],"type":"blockquote"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Validate a webhook signature"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Verifies that the provided signature matches the payload and secret."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"This is intended for debugging webhook integrations ONLY."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Business Applications:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Webhook troubleshooting"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Signature validation testing"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},{"name":"CfAccessClientId","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Id","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}]},{"name":"CfAccessClientSecret","scopes":[],"type":"apiKey","in":"header","paramName":"CF-Access-Client-Secret","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}]}]},{"schemes":[{"name":"BearerAuth","scopes":[],"type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_142","exampleIds":["paths/~1api~1v1~1webhook~1test~1validate/post/requestBody/content/application~1json/example"]}},"schemaId":"schema_142","exampleIds":["paths/~1api~1v1~1webhook~1test~1validate/post/requestBody/content/application~1json/example"],"pointer":"/paths/~1api~1v1~1webhook~1test~1validate/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/api/v1/webhook/test/validate","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"},{"id":"CfAccessClientId","type":"apiKey","name":"CF-Access-Client-Id","in":"header"},{"id":"CfAccessClientSecret","type":"apiKey","name":"CF-Access-Client-Secret","in":"header"}],"scopes":[]},{"schemes":[{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_142","exampleIds":["paths/~1api~1v1~1webhook~1test~1validate/post/requestBody/content/application~1json/example"]}},"responseCodes":["200","400","401","403","500"],"pointer":"/api/v1/webhook/test/validate","href":"event-subscriptions/validatewebhooktestsignature","openApiOperationId":"validateWebhookTestSignature","summary":"Validate a webhook signature","securityGroups":[{"BearerAuth":[],"CfAccessClientId":[],"CfAccessClientSecret":[]},{"BearerAuth":[]}]},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"schemaId":"schema_142","exampleIds":["paths/~1api~1v1~1webhook~1test~1validate/post/requestBody/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_142","exampleIds":["paths/~1api~1v1~1webhook~1test~1validate/post/requestBody/content/application~1json/example"]}},"examples":[{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The validation result, also when the signature does not match ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"isValid: false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). The body is not"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"wrapped in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"meta"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_143"}},"schemaId":"schema_143"},{"code":"400","description":"Invalid input data"},{"code":"401","description":"Unauthorized - Invalid or missing authentication token"},{"code":"403","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Forbidden - Insufficient permissions (requires WEBHK_TST)"},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"500","description":"Internal server error"}],"pointer":"/paths/~1api~1v1~1webhook~1test~1validate/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_143","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_143"}}},{"code":"400"},{"code":"401"},{"code":"403"},{"code":"500"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/event-subscriptions/validatewebhooktestsignature"}],"panels":[]}]},"httpPath":"/api/v1/webhook/test/validate"}],"content":{"contentType":"group","meta":{"name":"Event Subscriptions"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Event subscriptions","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create and manage webhook subscriptions for entity events."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The event subscription endpoints provide:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Webhook management"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Create, update, and deactivate webhook subscriptions"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event filtering"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Subscribe to specific entity types and operations (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CREATED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UPDATED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POSTED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Security"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": Retrieve webhook signing secrets for payload verification"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/api/v1/event-subscriptions/catalog","summary":"Get available event types catalog","prefix":{"name":"get","color":"get"},"badges":[],"link":"/event-subscriptions/geteventsettingscatalog","deprecated":false},{"title":"/api/v1/event-subscriptions","summary":"Create a webhook subscription","prefix":{"name":"post","color":"post"},"badges":[],"link":"/event-subscriptions/createeventsubscription","deprecated":false},{"title":"/api/v1/event-subscriptions","summary":"List the caller's webhook subscriptions","prefix":{"name":"get","color":"get"},"badges":[],"link":"/event-subscriptions/listeventsubscriptions","deprecated":false},{"title":"/api/v1/event-subscriptions/{id}","summary":"Update a webhook subscription","prefix":{"name":"patch","color":"patch"},"badges":[],"link":"/event-subscriptions/updateeventsubscription","deprecated":false},{"title":"/api/v1/event-subscriptions/{id}","summary":"Deactivate a webhook subscription","prefix":{"name":"delete","color":"delete"},"badges":[],"link":"/event-subscriptions/deactivateeventsubscription","deprecated":false},{"title":"/api/v1/event-subscriptions/{id}/reactivate","summary":"Reactivate a webhook subscription","prefix":{"name":"post","color":"post"},"badges":[],"link":"/event-subscriptions/reactivateeventsubscription","deprecated":false},{"title":"/api/v1/event-subscriptions/{id}/deliveries","summary":"Retrieve webhook delivery attempts for a subscription","prefix":{"name":"get","color":"get"},"badges":[],"link":"/event-subscriptions/getwebhookdeliveryhistory","deprecated":false},{"title":"/api/v1/event-subscriptions/webhook/secret","summary":"Get webhook signing secret","prefix":{"name":"get","color":"get"},"badges":[],"link":"/event-subscriptions/getsubscriptionsecret","deprecated":false},{"title":"/api/v1/webhook/test/generate","summary":"Generate a test webhook payload and signature","prefix":{"name":"post","color":"post"},"badges":[],"link":"/event-subscriptions/generatewebhooktestpayload","deprecated":false},{"title":"/api/v1/webhook/test/validate","summary":"Validate a webhook signature","prefix":{"name":"post","color":"post"},"badges":[],"link":"/event-subscriptions/validatewebhooktestsignature","deprecated":false}]}]}]}]}},{"type":"group","label":"Webhook deliveries","link":"/bundle/webhooks","routeSlug":"/bundle/webhooks","items":[{"label":"Event delivery","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":true,"type":"link","link":"/bundle/webhooks/eventdelivery","routeSlug":"/bundle/webhooks/eventdelivery","metadata":{"seo":{"title":"Event delivery","description":"Aiwyn sends this request to a subscription's deliveryUrl each time an event it subscribes to happens(an entityType and operation from GET /api/v1/event-subscriptions/catalog). One request carries oneevent."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"eventDelivery","name":"Event delivery","isWebhook":true,"pointer":"/paths/event/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Event delivery","isWebhook":true,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Aiwyn sends this request to a subscription's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"deliveryUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" each time an event it subscribes to happens"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entityType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/event-subscriptions/catalog"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). One request carries one"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The same URL can also receive a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"subscription.disabled"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" notification, which is not an event: its body is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{type, timestamp, tenant, subscriptionId, deliveryUrl, consecutiveFailures, reason, lastStatusCode, lastErrorMessage}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", it carries "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Notification-Type: subscription.disabled"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and none of the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Event-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Event-Operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Delivery-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" headers. Its "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Signature"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"computed the same way. Check "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Notification-Type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" before parsing a request as an event."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Verify the signature before trusting the body."},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Signature"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"sha256="},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" followed by the Base64"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"HMAC-SHA256 of the raw request body, keyed with your signing secret"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/event-subscriptions/webhook/secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). Compute it over the bytes you received, before"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"parsing the JSON, and compare in constant time. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/webhook/test/generate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /api/v1/webhook/test/validate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" let you check your implementation."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Respond with any "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"2xx"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" within 30 seconds."},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" The response body is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"5xx"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response or a connection error is retried up to two more times, about a minute and then five"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"minutes later, with the same "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Event-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and a new "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Delivery-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Any other non-"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"2xx"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"response, or no response within 30 seconds, is not retried. Reconcile missed events through the API."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"A slow endpoint may still process a timed-out request, so acknowledge first and do the work"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"afterwards."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The same change can be reported twice, as two events with different ids, so check whether you have"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"already handled the change (the record's current state, or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entityType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entityId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rather than relying on "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Event-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" alone."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Deliveries are not guaranteed to arrive in event order; use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.eventTimestamp"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to order them."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Consent events"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CONSENT_RECORDED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") fire once a consent document's signers have settled"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"on an outcome. With"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ALL_SIGNATURES_REQUIRED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", every signer agreed ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"AFFIRMATIVE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") or one declined ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"NEGATIVE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). With"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ONE_SIGNATURE_REQUIRED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", one signer agreed ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"AFFIRMATIVE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") or every signer declined ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"NEGATIVE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). They fire"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"when the consent is answered, whether or not the engagement goes on to be signed. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.data.metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"carries "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagementDocumentId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"signatureRequirementType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"consentStatus"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"decidedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and one entry per"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"signer in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"signers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.data.relatedEntitiesData"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" carries the engagement's clients, client groups and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobs. An answer given after the outcome is settled raises no new event. A paper consent the firm records"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"when it executes an engagement manually raises the same event, with the staff member as the actor."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"decidedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"consentProvidedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" have no offset: portal answers are in UTC, and a paper consent carries"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the time the firm entered. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"decidedAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a decline recorded without a date."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"File events"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entityType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"File"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") are only delivered to an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"https"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" URL. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.data.primaryRecord.file"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"carries a short-lived signed "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"downloadUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (except for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DELETED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.data.metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is omitted."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request item events"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"RequestItem"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"SENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"APPROVED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"REJECTED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") carry the item in"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.data.primaryRecord"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.data.metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" carries the item's previous status in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"status_old"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", plus"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"recipients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"name"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"email"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"SENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and the reviewer's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"notes"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"REJECTED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ClientRequest"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"VIEWED"},"children":[],"type":"code"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is sent each time a staff member opens a client request in the Firm Portal."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.entityId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is the client request's id. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.data.primaryRecord"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"relatedEntitiesData"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", so fetch the client request by that id if you need it, and don't rely on "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every attempt, with its status code and response, is listed by"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/event-subscriptions/{id}/deliveries"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"item-content","variant":"headers","label":"Headers","labelTranslationKey":"header","parameters":[{"name":"X-Signature","in":"header","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"sha256="},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" followed by the Base64 HMAC-SHA256 of the raw body, keyed with your signing secret."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true,"example":"sha256=Epvu8EP9JvCXSg+nVg9aTomZkJ7u3vESqWQjFs1WmkA="},{"name":"X-Aiwyn-Event-Id","in":"header","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The event's id, the same as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true,"example":"7001"},{"name":"X-Aiwyn-Event-Operation","in":"header","schemaId":"schema_65","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The event's operation, the same as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"event.type"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"required":true,"example":"POSTED"},{"name":"X-Aiwyn-Subscription-Id","in":"header","schemaId":"schema_65","description":"The id of the subscription this delivery is for.","required":true,"example":"9"},{"name":"X-Aiwyn-Delivery-Id","in":"header","schemaId":"schema_144","description":"Unique per request, including a repeated delivery of the same event.","required":true,"example":"0f6b1f7c-3c43-4c38-9a0e-0d3b8f7b2a51"},{"name":"X-Aiwyn-Timestamp","in":"header","schemaId":"schema_137","description":"When this attempt was sent (ISO 8601, UTC).","required":true,"example":"2026-11-01T18:04:05.123Z"},{"name":"X-Aiwyn-Tenant","in":"header","schemaId":"schema_65","description":"Your firm's tenant identifier.","required":true,"example":"acmecpa"}],"pointer":"/paths/event/post/parameters"},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"isEvent":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/WebhookDelivery","exampleIds":["paths/event/post/requestBody/content/application~1json/examples/payment","paths/event/post/requestBody/content/application~1json/examples/consent","paths/event/post/requestBody/content/application~1json/examples/file","paths/event/post/requestBody/content/application~1json/examples/requestItem"]}},"schemaId":"components/schemas/WebhookDelivery","exampleIds":["paths/event/post/requestBody/content/application~1json/examples/payment","paths/event/post/requestBody/content/application~1json/examples/consent","paths/event/post/requestBody/content/application~1json/examples/file","paths/event/post/requestBody/content/application~1json/examples/requestItem"],"pointer":"/paths/event/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"webhook","method":"POST","path":"event","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[{"name":"X-Signature","in":"header","required":true,"example":"sha256=Epvu8EP9JvCXSg+nVg9aTomZkJ7u3vESqWQjFs1WmkA=","schemaId":"schema_65"},{"name":"X-Aiwyn-Event-Id","in":"header","required":true,"example":"7001","schemaId":"schema_65"},{"name":"X-Aiwyn-Event-Operation","in":"header","required":true,"example":"POSTED","schemaId":"schema_65"},{"name":"X-Aiwyn-Subscription-Id","in":"header","required":true,"example":"9","schemaId":"schema_65"},{"name":"X-Aiwyn-Delivery-Id","in":"header","required":true,"example":"0f6b1f7c-3c43-4c38-9a0e-0d3b8f7b2a51","schemaId":"schema_144"},{"name":"X-Aiwyn-Timestamp","in":"header","required":true,"example":"2026-11-01T18:04:05.123Z","schemaId":"schema_137"},{"name":"X-Aiwyn-Tenant","in":"header","required":true,"example":"acmecpa","schemaId":"schema_65"}],"cookie":[]},"security":[],"requestBody":{"application/json":{"schemaId":"components/schemas/WebhookDelivery","exampleIds":["paths/event/post/requestBody/content/application~1json/examples/payment","paths/event/post/requestBody/content/application~1json/examples/consent","paths/event/post/requestBody/content/application~1json/examples/file","paths/event/post/requestBody/content/application~1json/examples/requestItem"]}},"responseCodes":["2XX","4XX","5XX"],"pointer":"event","href":"webhooks/eventdelivery","openApiOperationId":"eventDelivery","summary":"Event delivery"},"isWebhook":true,"hideReplay":false,"schemaId":"components/schemas/WebhookDelivery","exampleIds":["paths/event/post/requestBody/content/application~1json/examples/payment","paths/event/post/requestBody/content/application~1json/examples/consent","paths/event/post/requestBody/content/application~1json/examples/file","paths/event/post/requestBody/content/application~1json/examples/requestItem"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/WebhookDelivery","exampleIds":["paths/event/post/requestBody/content/application~1json/examples/payment","paths/event/post/requestBody/content/application~1json/examples/consent","paths/event/post/requestBody/content/application~1json/examples/file","paths/event/post/requestBody/content/application~1json/examples/requestItem"]}},"examples":[{},{},{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"2XX","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Delivered. Any "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"2xx"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" status counts; the body is ignored."},"children":[],"type":"text"}],"type":"paragraph"}]},{"code":"4XX","description":"Not delivered and not retried."},{"code":"5XX","description":"Not delivered and not retried."}],"pointer":"/paths/event/post/responses"}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/webhooks/eventdelivery"}],"panels":[]}]},"httpPath":"event"}],"content":{"contentType":"group","meta":{"name":"Webhooks"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Webhook deliveries","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The requests Aiwyn sends to your subscription's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"deliveryUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a subscribed event happens."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Create subscriptions with the event subscription endpoints."},"children":[],"type":"text"}],"type":"paragraph"}]}],"panels":[{"children":[{"kind":"group-items","title":"Webhooks","titleTranslationKey":"webhooks","items":[{"title":"event","summary":"Event delivery","prefix":{"name":"post","color":"post"},"badges":[],"link":"/webhooks/eventdelivery","deprecated":false}]}]}]}]}}],"store":{"schemaStore":{"components/schemas/Error":{"id":"components/schemas/Error","kind":"json-schema","title":"Error","data":{"type":"object","description":"Standard error response format","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message","example":"pageSize must be an integer from 1 to 1000"},"code":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Machine-readable error code. Absent when the gateway rejects "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"before the query runs; present on errors from the query itself."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"validation-failed"},"details":{"type":"string","description":"Additional error context"}}}},"components/schemas/DraftInvoiceHistory":{"id":"components/schemas/DraftInvoiceHistory","kind":"json-schema","title":"DraftInvoiceHistory","data":{"type":"object","description":"Draft invoice history record with client and draft invoice details","required":["clientId","invoiceId","jobId","client","draftInvoice"],"properties":{"clientId":{"type":"integer","description":"Client identifier","example":7720},"invoiceId":{"type":["integer","null"],"description":"Identifier of the posted invoice. Null until the draft has produced an invoice.","example":125890},"jobId":{"type":"integer","description":"Associated job/project identifier","example":2514},"client":{"type":"object","description":"Client summary information","required":["active","clientRef","name","pmsRef"],"properties":{"active":{"type":"boolean","example":true},"clientRef":{"type":"string","example":"TF-2024-789"},"name":{"type":"string","example":"TechFlow Enterprises"},"pmsRef":{"type":"string","example":"240815"}}},"draftInvoice":{"type":["object","null"],"description":"Draft invoice metadata. Null when the history record has no draft invoice\nor the draft's AR transaction is inactive.\n","required":["approvedAt","arTranId","approverStaffId","approvedByStaffId","invoiceId","isActive","pms_invoice_number","status","attachTimeEntries","automaticallyBillOn","billAddressContactInfoId","billerStaffId","createdAt","createdByStaffId","currentAssignedStaffId","deliveryMethod","emailRecipients","expenseLineItemStrategy","invoiceDate","lineItemStrategy","postOn","reversalReason","reversedAt","reversedByStaffId","reviewedAt","reviewedByStaffId","reviewerStaffId","scheduledByStaffId","senderStaffId","timeEntryGrouping","timeEntryPageOrientation","updatedAt","wipUnbilledAsOf"],"properties":{"approvedAt":{"type":["string","null"],"format":"date-time","description":"Approval timestamp. Null until the draft is approved.","example":"2024-03-15T14:32:18+00:00"},"arTranId":{"type":"integer","description":"AR transaction identifier of the draft invoice","example":125880},"approverStaffId":{"type":"integer","example":301},"approvedByStaffId":{"type":["integer","null"],"description":"Staff who approved the draft. Null until the draft is approved.","example":301},"invoiceId":{"type":["integer","null"],"description":"Identifier of the posted invoice. Null until the draft is posted.","example":125890},"isActive":{"type":"boolean","example":true},"pms_invoice_number":{"type":["string","null"],"description":"Invoice number in the practice management system. Null unless the draft was pushed to a PMS.","example":null},"status":{"type":"string","example":"APPROVED"},"attachTimeEntries":{"type":["boolean","null"],"description":"Whether time entries are attached to the invoice","example":false},"automaticallyBillOn":{"type":["string","null"],"format":"date-time","description":"When the draft is scheduled to bill automatically. Null when it is not scheduled.","example":null},"billAddressContactInfoId":{"type":["integer","null"],"description":"Identifier of the contact info used as the bill-to address","example":4410},"billerStaffId":{"type":"integer","description":"Identifier of the biller staff member","example":301},"createdAt":{"type":"string","format":"date-time","description":"When the draft was created","example":"2024-05-12T22:50:20.595961+00:00"},"createdByStaffId":{"type":["integer","null"],"description":"Identifier of the staff member who created the draft","example":301},"currentAssignedStaffId":{"type":"integer","description":"Identifier of the staff member the draft is currently assigned to","example":301},"deliveryMethod":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How the invoice will be delivered: EMAIL, DOWNLOAD, EMAIL_AND_DOWNLOAD or POST_ONLY"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"EMAIL"},"emailRecipients":{"type":["string","null"],"description":"Email recipients for the invoice","example":"ap@techflow.example"},"expenseLineItemStrategy":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How expenses are presented as line items: SINGLE_LINE, HIDE or ALL"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"HIDE"},"invoiceDate":{"type":["string","null"],"format":"date","description":"Invoice date to use when the draft is billed","example":null},"lineItemStrategy":{"type":["string","null"],"description":"How time is presented as line items","example":"JOB"},"postOn":{"type":["string","null"],"format":"date","description":"Date the invoice is scheduled to post","example":null},"reversalReason":{"type":["string","null"],"description":"Reason the draft was reversed","example":null},"reversedAt":{"type":["string","null"],"format":"date-time","description":"When the draft was reversed","example":null},"reversedByStaffId":{"type":["integer","null"],"description":"Identifier of the staff member who reversed the draft","example":null},"reviewedAt":{"type":["string","null"],"format":"date-time","description":"When the draft was reviewed","example":"2024-03-14T10:05:00+00:00"},"reviewedByStaffId":{"type":["integer","null"],"description":"Identifier of the staff member who reviewed the draft","example":301},"reviewerStaffId":{"type":"integer","description":"Identifier of the reviewer staff member","example":301},"scheduledByStaffId":{"type":["integer","null"],"description":"Identifier of the staff member who scheduled the draft","example":null},"senderStaffId":{"type":"integer","description":"Identifier of the sender staff member","example":301},"timeEntryGrouping":{"type":["string","null"],"description":"How attached time entries are grouped","example":null},"timeEntryPageOrientation":{"type":["string","null"],"description":"Page orientation of attached time entries","example":null},"updatedAt":{"type":"string","format":"date-time","description":"When the draft was last updated","example":"2024-05-12T22:50:20.595961+00:00"},"wipUnbilledAsOf":{"type":["string","null"],"format":"date-time","description":"Cut-off date for unbilled WIP included in the draft","example":null}}}}}},"components/schemas/DraftInvoiceHistoryListResponse":{"id":"components/schemas/DraftInvoiceHistoryListResponse","kind":"json-schema","title":"DraftInvoiceHistoryListResponse","data":{"type":"object","description":"Standard response format for draft invoice history endpoints","required":["draftInvoices","total"],"properties":{"draftInvoices":{"type":"array","items":{"$ref":"#/components/schemas/DraftInvoiceHistory"}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of draft invoice history records matching criteria","example":94}}}}}}}},"components/schemas/ClientStaffMember":{"id":"components/schemas/ClientStaffMember","kind":"json-schema","title":"ClientStaffMember","data":{"type":"object","description":"Staff member assigned to a client or client group (partner, manager, billing manager)","required":["id","firstName","lastName","email"],"properties":{"id":{"type":"integer","example":53},"firstName":{"type":"string","example":"Allen"},"lastName":{"type":"string","example":"Hermiston"},"email":{"type":["string","null"],"example":"allen.hermiston@company.com"}}}},"components/schemas/ClientGroup":{"id":"components/schemas/ClientGroup","kind":"json-schema","title":"ClientGroup","data":{"type":"object","description":"Client group record with assigned staff and office information","required":["id","name","pmsRef","parentClientId","primaryContactId","billingContactId","partnerStaffId","managerStaffId","officeId","active","isManagedByAiwyn","createdAt","updatedAt","version","customFieldValues","partnerStaff","managerStaff","office"],"properties":{"id":{"type":"integer","description":"Unique client group identifier","example":10},"name":{"type":"string","description":"Client group name","example":"Acme Corp Group"},"pmsRef":{"type":"string","description":"Practice Management System reference","example":"GRP-001"},"parentClientId":{"type":["integer","null"],"description":"ID of the parent client, if any","example":null},"primaryContactId":{"type":["integer","null"],"description":"ID of the primary contact","example":201},"billingContactId":{"type":["integer","null"],"description":"ID of the billing contact","example":202},"partnerStaffId":{"type":["integer","null"],"description":"ID of the assigned partner staff member","example":101},"managerStaffId":{"type":["integer","null"],"description":"ID of the assigned manager staff member","example":102},"officeId":{"type":["integer","null"],"description":"ID of the associated office","example":5},"active":{"type":"boolean","description":"Whether the client group is active","example":true},"isManagedByAiwyn":{"type":"boolean","description":"Whether the client group is managed by Aiwyn","example":false},"createdAt":{"type":"string","format":"date-time","description":"Record creation timestamp","example":"2024-01-15T10:00:00.000000+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Last modification timestamp","example":"2024-06-20T14:30:00.000000+00:00"},"version":{"type":"integer","description":"Record version number","example":3},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields for the client group, keyed by custom field code","example":{"region":"West"}},"partnerStaff":{"description":"Assigned partner staff member; null when the group has no partner","anyOf":[{"$ref":"#/components/schemas/ClientStaffMember"},{"type":"null"}]},"managerStaff":{"description":"Assigned manager staff member; null when the group has no manager","anyOf":[{"$ref":"#/components/schemas/ClientStaffMember"},{"type":"null"}]},"office":{"type":["object","null"],"description":"Associated office; null when the group has no office","required":["id","pmsRef","name"],"properties":{"id":{"type":"integer","example":5},"pmsRef":{"type":"string","example":"OFF-5"},"name":{"type":["string","null"],"example":"San Francisco"}}}}}},"components/schemas/ClientBusinessEntityRef":{"id":"components/schemas/ClientBusinessEntityRef","kind":"json-schema","title":"ClientBusinessEntityRef","data":{"type":"object","description":"Business entity (entity type) classification of a client","required":["id","name","ref","clientBusinessEntityType","pmsRefs"],"properties":{"id":{"type":"integer","example":4},"name":{"type":"string","example":"S Corporation"},"ref":{"type":"string","example":"SCORP"},"clientBusinessEntityType":{"type":"string","example":"Business"},"pmsRefs":{"type":"string","description":"Practice Management System reference of the business entity","example":"SCORP"}}}},"components/schemas/Client":{"id":"components/schemas/Client","kind":"json-schema","title":"Client","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client record as returned by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/clients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/clients/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Every listed property is always present; foreign keys and relationships whose column"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"is optional are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when unset."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["id","pmsRef","clientRef","name","active","ebilling","emailStatement","chargeAdminFee","clientContactInfoId","excludeFromCollections","default_billing_day","prefContactId","billingContactId","billingClientId","departmentId","officeId","industryId","clientGroupId","partnerStaffId","managerStaffId","staffBillingManagerId","clientTypeId","clientBusinessEntityId","fiscalYearEndMonth","fiscalYearEndDay","createdAt","updatedAt","customFieldValues","orgId","clientKey","updateByStaffId","exclusionStatusUpdatedAt","isManagedByAiwyn","isCreatedByAiwyn","originatingPartnerStaffId","billingNotes","description","notes","noticePeriod","secondaryContactId","fein","status","invoiceDeliveryMethod","mergedInto","inactivateMergedRecord","department","office","industry","clientType","clientBusinessEntity","entityType","partnerStaff","managerStaff","billManager","relationshipOwner"],"properties":{"id":{"type":"integer","description":"Unique client identifier","example":2180},"pmsRef":{"type":"string","description":"Practice Management System reference","example":"1155"},"clientRef":{"type":"string","description":"External client reference number","example":"41664"},"name":{"type":"string","description":"Client full name or company name","example":"Aaron Fahey"},"active":{"type":"boolean","description":"Client active status","example":true},"ebilling":{"type":"boolean","description":"Whether the client receives electronic billing","example":true},"emailStatement":{"type":"boolean","description":"Whether statements are emailed to the client","example":true},"chargeAdminFee":{"type":"boolean","description":"Whether an administrative fee is charged to the client","example":false},"clientContactInfoId":{"type":["integer","null"],"description":"ID of the client's own contact info (address) record","example":9957},"excludeFromCollections":{"type":["boolean","null"],"description":"Whether the client is excluded from collections","example":false},"default_billing_day":{"type":["integer","null"],"description":"Default day of the month on which the client is billed","example":null},"prefContactId":{"type":["integer","null"],"description":"ID of the preferred contact","example":601},"billingContactId":{"type":["integer","null"],"description":"ID of the billing contact","example":null},"billingClientId":{"type":["integer","null"],"description":"ID of the client billed on this client's behalf","example":null},"departmentId":{"type":["integer","null"],"description":"ID of the client's department","example":3},"officeId":{"type":"integer","description":"ID of the client's office","example":1},"industryId":{"type":["integer","null"],"description":"ID of the client's industry","example":null},"clientGroupId":{"type":["integer","null"],"description":"ID of the client group the client belongs to","example":null},"partnerStaffId":{"type":["integer","null"],"description":"ID of assigned partner staff member; null when the client has no partner","example":53},"managerStaffId":{"type":["integer","null"],"description":"ID of assigned manager staff member; null when the client has no manager","example":19},"staffBillingManagerId":{"type":["integer","null"],"description":"ID of the staff member who is the client's billing manager","example":null},"clientTypeId":{"type":["integer","null"],"description":"ID of the client type","example":7},"clientBusinessEntityId":{"type":["integer","null"],"description":"ID of the client business entity (entity type)","example":4},"fiscalYearEndMonth":{"type":["integer","null"],"description":"Month (1-12) of the client's fiscal year end","example":12},"fiscalYearEndDay":{"type":["integer","null"],"description":"Day (1-31) of the client's fiscal year end","example":31},"createdAt":{"type":"string","format":"date-time","description":"Client record creation timestamp","example":"2023-05-12T22:43:55.488054+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Last modification timestamp","example":"2023-06-09T21:34:28.817274+00:00"},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Custom field values for the client, keyed by custom field code","example":{"industry_niche":"Manufacturing","naics_code":"333120"}},"orgId":{"type":["integer","null"],"description":"ID of the client's organization","example":null},"clientKey":{"type":["string","null"],"description":"Unique business key for the client","example":"AARON-FAHEY"},"updateByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the client","example":53},"exclusionStatusUpdatedAt":{"type":["string","null"],"format":"date-time","description":"When the collections exclusion setting was last changed","example":"2023-05-12T22:43:55.488054+00:00"},"isManagedByAiwyn":{"type":"boolean","description":"Whether Aiwyn manages the record's lifecycle","example":false},"isCreatedByAiwyn":{"type":"boolean","description":"Whether the record was created in Aiwyn","example":false},"originatingPartnerStaffId":{"type":["integer","null"],"description":"ID of the staff member who is the client's originating partner","example":null},"billingNotes":{"type":["string","null"],"description":"Notes about the client's billing","example":null},"description":{"type":["string","null"],"description":"Description of the client","example":null},"notes":{"type":["string","null"],"description":"Notes about the client","example":null},"noticePeriod":{"type":["integer","null"],"description":"Notice period, in days, for ending work with the client","example":null},"secondaryContactId":{"type":["integer","null"],"description":"ID of the secondary contact","example":null},"fein":{"type":["string","null"],"description":"Federal Employer Identification Number","example":"12-3456789"},"status":{"type":"string","description":"Status of the client, for example ACTIVE, INACTIVE, PROSPECT or CLOSED","example":"ACTIVE"},"invoiceDeliveryMethod":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Default delivery method for the client's invoices, one of EMAIL, DOWNLOAD, EMAIL_AND_DOWNLOAD or POST_ONLY"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"EMAIL"},"mergedInto":{"type":["integer","null"],"description":"For a client merged into another as a duplicate, the ID of the client it was merged into.\nA merged client is always inactive; null when the client has not been merged.\n","example":null},"inactivateMergedRecord":{"type":"boolean","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"For a merged client, whether the merge also made the client it was merged into inactive."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Not an indicator that the client was merged; use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"mergedInto"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for that."},"children":[],"type":"text"}],"type":"paragraph"}],"example":false},"department":{"type":["object","null"],"description":"Client department; null when the client has no department","required":["id","pmsRef","name"],"properties":{"id":{"type":"integer","example":3},"pmsRef":{"type":"string","example":"TAX"},"name":{"type":"string","example":"Tax"}}},"office":{"type":"object","description":"Client office","required":["id","pmsRef","name","city","stateProvince","country"],"properties":{"id":{"type":"integer","example":1},"pmsRef":{"type":"string","example":"OFF-1"},"name":{"type":["string","null"],"example":"Charlotte"},"city":{"type":["string","null"],"example":"Charlotte"},"stateProvince":{"type":["string","null"],"example":"NC"},"country":{"type":["string","null"],"example":"US"}}},"industry":{"type":["object","null"],"description":"Client industry; null when the client has no industry","required":["id","name","ref"],"properties":{"id":{"type":"integer","example":2},"name":{"type":"string","example":"Manufacturing"},"ref":{"type":"string","example":"MFG"}}},"clientType":{"type":["object","null"],"description":"Client type; null when the client has no type","required":["id","name","pmsRef"],"properties":{"id":{"type":"integer","example":7},"name":{"type":"string","example":"Individual"},"pmsRef":{"type":["string","null"],"example":"IND"}}},"clientBusinessEntity":{"description":"Client business entity; null when the client has none","anyOf":[{"$ref":"#/components/schemas/ClientBusinessEntityRef"},{"type":"null"}]},"entityType":{"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Alias of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clientBusinessEntity"},"children":[],"type":"code"}],"type":"paragraph"}],"anyOf":[{"$ref":"#/components/schemas/ClientBusinessEntityRef"},{"type":"null"}]},"partnerStaff":{"description":"Assigned partner staff member; null when the client has no partner","anyOf":[{"$ref":"#/components/schemas/ClientStaffMember"},{"type":"null"}]},"managerStaff":{"description":"Assigned manager staff member; null when the client has no manager","anyOf":[{"$ref":"#/components/schemas/ClientStaffMember"},{"type":"null"}]},"billManager":{"description":"Staff billing manager; null when the client has none","anyOf":[{"$ref":"#/components/schemas/ClientStaffMember"},{"type":"null"}]},"relationshipOwner":{"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Alias of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"partnerStaff"},"children":[],"type":"code"}],"type":"paragraph"}],"anyOf":[{"$ref":"#/components/schemas/ClientStaffMember"},{"type":"null"}]}}}},"components/schemas/ClientContactInfo":{"id":"components/schemas/ClientContactInfo","kind":"json-schema","title":"ClientContactInfo","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client contact information details. The address, city, state, and zip_code"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"fields carry the same postal-address shape defined by the reusable Address schema."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["id","firstName","lastName","email","phone"],"properties":{"id":{"type":"integer","description":"Unique contact info identifier","example":9957},"firstName":{"type":["string","null"],"description":"Contact first name","example":"John"},"lastName":{"type":["string","null"],"description":"Contact last name","example":"Doe"},"email":{"type":["string","null"],"format":"email","description":"Contact email address","example":"loree.kling@yahoo.com"},"phone":{"type":["string","null"],"description":"Contact phone number","example":"1-555-123-4567"},"address":{"type":["string","null"],"description":"Street address (see the Address schema)","example":"123 Main Street"},"city":{"type":["string","null"],"description":"City (see the Address schema)","example":"Anytown"},"state":{"type":["string","null"],"description":"State or province code (see the Address schema)","example":"CA"},"zip_code":{"type":["string","null"],"description":"Postal / ZIP code (see the Address schema)","example":"12345"}}}},"components/schemas/ClientDetail":{"id":"components/schemas/ClientDetail","kind":"json-schema","title":"ClientDetail","data":{"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client record as returned by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /gql/v1/client/{id}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":": every "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Client"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" property plus the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"client's own contact info."},"children":[],"type":"text"}],"type":"paragraph"}],"allOf":[{"$ref":"#/components/schemas/Client"},{"type":"object","required":["clientContactInfo"],"properties":{"clientContactInfo":{"description":"The client's own contact info record; null when the client has none","anyOf":[{"$ref":"#/components/schemas/ClientContactInfo"},{"type":"null"}]}}}]}},"components/schemas/JobRecord":{"id":"components/schemas/JobRecord","kind":"json-schema","title":"JobRecord","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Job row from the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" table, as returned by the job list and by-id operations."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["id","pmsRef","jobRef","name","status","isActive","clientId","deptId","officeId","jobTemplateId","managerStaffId","partnerStaffId","startDate","endDate","dueDate","targetStartDate","targetedStartDate","targetEndDate","targetedEndDate","feeStructureId","feeStructureV4","sysRefs","createdAt","updatedAt","version"],"properties":{"id":{"type":"integer","description":"Unique job identifier","example":5012},"pmsRef":{"type":"string","description":"External PMS reference","example":"JOB-5012"},"jobRef":{"type":["string","null"],"description":"Internal job reference. Null when not set.","example":"J-0005012"},"name":{"type":"string","description":"Job name","example":"Q1 Financial Review 2025"},"status":{"type":["string","null"],"description":"Job status","example":"ACTIVE"},"isActive":{"type":"boolean","description":"Whether the job is active","example":true},"clientId":{"type":"integer","description":"Associated client identifier","example":1001},"deptId":{"type":["integer","null"],"description":"Associated department identifier. Null when the job has no department.","example":7},"officeId":{"type":["integer","null"],"description":"Associated office identifier. Null when the job has no office.","example":2},"jobTemplateId":{"type":["integer","null"],"description":"Associated job template identifier. Null when the job was not created from a template.","example":300},"managerStaffId":{"type":["integer","null"],"description":"Staff identifier for the job manager. Null when no manager is assigned.","example":102},"partnerStaffId":{"type":["integer","null"],"description":"Staff identifier for the job partner. Null when no partner is assigned.","example":101},"startDate":{"type":["string","null"],"format":"date-time","description":"Job start date. Null when not set.","example":"2025-01-01T00:00:00Z"},"endDate":{"type":["string","null"],"format":"date-time","description":"Job end date. Null when not set.","example":"2025-03-31T23:59:59Z"},"dueDate":{"type":["string","null"],"format":"date-time","description":"Job due date (alias for endDate). Null when not set.","example":"2025-03-31T23:59:59Z"},"targetStartDate":{"type":["string","null"],"format":"date-time","description":"Target start date. Null when not set.","example":"2025-01-01T00:00:00Z"},"targetedStartDate":{"type":["string","null"],"format":"date-time","description":"Same value as targetStartDate. Null when not set.","example":"2025-01-01T00:00:00Z"},"targetEndDate":{"type":["string","null"],"format":"date-time","description":"Target end date. Null when not set.","example":"2025-03-31T23:59:59Z"},"targetedEndDate":{"type":["string","null"],"format":"date-time","description":"Same value as targetEndDate. Null when not set.","example":"2025-03-31T23:59:59Z"},"feeStructureId":{"type":["integer","null"],"description":"Associated fee structure identifier. Null when the job has no fee structure.","example":42},"feeStructureV4":{"type":["object","null"],"description":"Fee structure details. Null when the job has no fee structure.","properties":{"id":{"type":"integer","example":42},"type":{"type":"string","example":"FIXED"},"amount":{"type":["number","null"],"example":5000},"active":{"type":"boolean","example":true}}},"sysRefs":{"type":["object","null"],"description":"System reference metadata"},"createdAt":{"type":"string","format":"date-time","description":"Record creation timestamp","example":"2025-01-02T03:04:05Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2025-01-03T10:11:12Z"},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Custom field values for the job, keyed by custom field code","example":{"industry_niche":"Manufacturing","naics_code":"333120"}},"version":{"type":"integer","description":"Record version for optimistic concurrency","example":3},"previousJobId":{"type":["integer","null"],"description":"Previous job in the series (job id).","example":null},"jobContactInfoId":{"type":["integer","null"],"description":"Contact info of the job (contact info id).","example":null},"billable":{"type":["boolean","null"],"description":"Whether the job is billable to the client.","example":true},"draftInvoiceId":{"type":["integer","null"],"description":"Draft invoice of the job (the draft invoice's AR transaction id).","example":null},"defaultBillingDay":{"type":["integer","null"],"description":"Default day of the month the job is billed.","example":1},"isManagedByAiwyn":{"type":["boolean","null"],"description":"Whether Aiwyn manages the record's lifecycle.","example":true},"isCreatedByAiwyn":{"type":["boolean","null"],"description":"Whether the record was created in Aiwyn.","example":true},"serviceDescription":{"type":["string","null"],"description":"Description of the service provided.","example":"Tax: General Tax Consulting"},"extendedServiceDescription":{"type":["string","null"],"description":"Extended description of the service provided.","example":null},"billingDay":{"type":["integer","null"],"description":"Day of the month the job is billed, when it differs from the default.","example":null},"createdByStaffId":{"type":["integer","null"],"description":"Staff member who created the job (staff id).","example":102},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff member who last updated the job (staff id).","example":102},"eFileStates":{"type":["string","null"],"description":"States where returns for the job are filed electronically.","example":"CA,NY"},"paperFileStates":{"type":["string","null"],"description":"States where returns for the job are filed on paper.","example":null},"jobType":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Kind of job, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"JOB"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNAPPLIED_PROGRESS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"JOB"},"overriddenPreviousJobId":{"type":["integer","null"],"description":"Overridden previous job (job id).","example":null},"estimationEnabled":{"type":["boolean","null"],"description":"Whether hour estimation is enabled for the job.","example":false},"estimationHours":{"type":["number","null"],"description":"Estimated hours for the job.","example":null},"jobStatusId":{"type":["integer","null"],"description":"Firm-defined job status (job status id).","example":3},"internalNote":{"type":["string","null"],"description":"Internal note on the job, visible only to firm staff.","example":null},"nameTemplate":{"type":["string","null"],"description":"Pattern used to generate the job name.","example":null},"primaryDeliverableTemplateId":{"type":["integer","null"],"description":"Primary deliverable template of the job (deliverable template id).","example":null},"primaryDeliverableId":{"type":["integer","null"],"description":"Primary deliverable of the job (deliverable id).","example":null},"originalTargetEndDate":{"type":["string","null"],"format":"date","description":"Planned end date before any extensions.","example":null},"extensionCount":{"type":["integer","null"],"description":"Number of extensions applied to the job.","example":0},"totalTaskCount":{"type":"integer","description":"Number of tasks on the job.","example":12},"completedTaskCount":{"type":"integer","description":"Number of completed tasks on the job.","example":4},"criToDoCount":{"type":"integer","description":"Number of client request items on the job that are to do.","example":2},"criOpenCount":{"type":"integer","description":"Number of client request items on the job that are open.","example":1},"criInReviewCount":{"type":"integer","description":"Number of client request items on the job that are in review.","example":0},"criRejectedCount":{"type":"integer","description":"Number of client request items on the job that were rejected.","example":0},"criDoneCount":{"type":"integer","description":"Number of client request items on the job that are done.","example":3},"rolloveredTo":{"type":["integer","null"],"description":"Job this one was rolled over to (job id).","example":null},"rolloveredFrom":{"type":["integer","null"],"description":"Job this one was rolled over from (job id).","example":null},"budgetedHours":{"type":"number","description":"Hours budgeted for the job.","example":40},"projectYear":{"type":["integer","null"],"description":"Year the job relates to.","example":2024},"totalClientRequestCount":{"type":"integer","description":"Number of client requests on the job.","example":2},"completedClientRequestCount":{"type":"integer","description":"Number of completed client requests on the job.","example":1},"actualHours":{"type":"number","description":"Hours recorded against the job.","example":12.5},"ownerStaffId":{"type":["integer","null"],"description":"Staff member who owns the job (staff id).","example":102}}}},"components/schemas/ContactInfoDetail":{"id":"components/schemas/ContactInfoDetail","kind":"json-schema","title":"ContactInfoDetail","data":{"type":"object","description":"Name, email, phone and address of a contact","required":["id","pms_ref","salutation","firstName","lastName","email","phone","address","address2","city","state","country","zip_code","active"],"properties":{"id":{"type":"integer","example":7001},"pms_ref":{"type":"string","example":"C-4451"},"salutation":{"type":["string","null"],"example":"Ms."},"firstName":{"type":["string","null"],"example":"Jane"},"lastName":{"type":["string","null"],"example":"Smith"},"email":{"type":["string","null"],"example":"jane.smith@acme.com"},"phone":{"type":["string","null"],"example":"555-0123"},"address":{"type":["string","null"],"example":"123 Main St"},"address2":{"type":["string","null"],"example":"Suite 400"},"city":{"type":["string","null"],"example":"Charlotte"},"state":{"type":["string","null"],"example":"NC"},"country":{"type":["string","null"],"example":"US"},"zip_code":{"type":["string","null"],"example":"28202"},"active":{"type":"boolean","example":true}}}},"components/schemas/Contact":{"id":"components/schemas/Contact","kind":"json-schema","title":"Contact","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Contact record as returned by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/contacts"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/contacts/search"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /gql/v1/contact/{id}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Field names are snake_case except the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"firstName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"lastName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contact_info"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Every listed property is always present; optional columns are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"null"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"when unset."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["id","pms_ref","active","contact_info_id","office_id","staff_id","type","fwd_email_confirmation","inactivated_at","created_at","updated_at","is_managed_by_aiwyn","is_created_by_aiwyn","username","custom_field_values","contact_info","contact_clients"],"properties":{"id":{"type":"integer","example":1001},"pms_ref":{"type":"string","example":"C-4451"},"active":{"type":"boolean","example":true},"contact_info_id":{"type":"integer","example":7001},"office_id":{"type":["integer","null"],"example":3},"staff_id":{"type":["integer","null"],"example":null},"type":{"type":["string","null"],"example":"Billing"},"fwd_email_confirmation":{"type":"boolean","example":false},"inactivated_at":{"type":["string","null"],"format":"date-time","description":"When the contact was inactivated (no time zone offset); null while active","example":null},"created_at":{"type":"string","format":"date-time","description":"When the record was created","example":"2024-03-01T15:20:11.104223+00:00"},"updated_at":{"type":"string","format":"date-time","description":"When the record was last updated","example":"2024-09-14T08:02:47.551092+00:00"},"is_managed_by_aiwyn":{"type":"boolean","description":"Whether Aiwyn manages the record's lifecycle","example":false},"is_created_by_aiwyn":{"type":"boolean","description":"Whether the record was created in Aiwyn","example":false},"username":{"type":["string","null"],"description":"Client portal username of the contact; null when the contact has no portal account","example":"jane.smith@acme.com"},"custom_field_values":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields for the contact, keyed by custom field code","example":null},"contact_info":{"$ref":"#/components/schemas/ContactInfoDetail"},"contact_clients":{"type":"array","description":"Links between this contact and clients (active and inactive)","items":{"type":"object","required":["client_id","contact_id","pms_ref","active"],"properties":{"client_id":{"type":"integer","example":2180},"contact_id":{"type":"integer","example":1001},"pms_ref":{"type":"string","example":"LL-9981"},"active":{"type":"boolean","example":true}}}}}}},"components/schemas/ContactListResponse":{"id":"components/schemas/ContactListResponse","kind":"json-schema","title":"ContactListResponse","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/contacts"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/contacts/search"},"children":[],"type":"code"}],"type":"paragraph"}],"required":["contacts","total"],"properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","description":"Number of contacts matching the request (the filtered count for search)","example":959}}}}}}}},"components/schemas/EngagementJobLink":{"id":"components/schemas/EngagementJobLink","kind":"json-schema","title":"EngagementJobLink","data":{"type":"object","description":"Link between an engagement and one of its projects (jobs)","required":["id","jobId","jobServiceTermId","engagementCustomJobServiceTermId","isActive","job"],"properties":{"id":{"type":"integer","example":1},"jobId":{"type":"integer","example":829},"jobServiceTermId":{"type":["integer","null"],"example":null},"engagementCustomJobServiceTermId":{"type":["integer","null"],"example":null},"isActive":{"type":"boolean","example":true},"job":{"type":["object","null"],"required":["id","name","status","clientId","pmsRef","jobRef","sysRefs"],"properties":{"id":{"type":"integer","example":829},"name":{"type":"string","example":"Expatriate Tax Services"},"status":{"type":["string","null"],"example":"OPEN"},"clientId":{"type":"integer","example":92},"pmsRef":{"type":"string","example":"AIWYN_829"},"jobRef":{"type":["string","null"],"example":null},"sysRefs":{"type":["object","null"],"example":{}}}}}}},"components/schemas/EngagementStaffSummary":{"id":"components/schemas/EngagementStaffSummary","kind":"json-schema","title":"EngagementStaffSummary","data":{"type":"object","description":"Staff member referenced by an engagement","required":["id","firstName","lastName","fullName","pmsRef","email","createdAt"],"properties":{"id":{"type":"integer","example":18},"firstName":{"type":"string","example":"Robert"},"lastName":{"type":"string","example":"Johnson"},"fullName":{"type":"string","example":"Robert Johnson"},"pmsRef":{"type":"string","example":"AIWYN_18"},"email":{"type":["string","null"],"example":"r.johnson@company.com"},"createdAt":{"type":"string","format":"date-time","example":"2026-06-08T16:26:36.875604+00:00"}}}},"components/schemas/Engagement":{"id":"components/schemas/Engagement","kind":"json-schema","title":"Engagement","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement row from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"vw_engagement"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", as returned by the engagement list, search and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"by-id operations. Only active engagements are returned."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["id","name","status","isActive","endDt","startDt","fiscalYear","engagementNameTemplate","createdAt","sentAt","executedAt","isStartOnAcceptance","updatedAt","paymentInfoType","canceledAt","mode","addressContactInfoId","originatingEngagementId","clientId","jobs","partnerStaff","managerStaff","createdByStaff","lastUpdatedByStaff","executedByStaff","renewedAt"],"properties":{"id":{"type":"integer","description":"Unique engagement identifier","example":85},"name":{"type":"string","description":"Engagement name generated from the name template","example":"2026 Annual Review and Tax 52150"},"status":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Engagement workflow status. One of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DRAFT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"IN_APPROVAL"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"READY_TO_SEND"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"SENT"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":","},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNDER_REVISION"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EXECUTED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CANCELED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ARCHIVED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". While an engagement is in review,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the value is the name of its current workflow step (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Pending Review"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"instead of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"IN_REVIEW"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"EXECUTED"},"isActive":{"type":"boolean","example":true},"endDt":{"type":["string","null"],"format":"date","description":"Engagement end date. Null when not set.","example":"2026-12-31"},"startDt":{"type":["string","null"],"format":"date","description":"Engagement start date. Null when not set (for example when the engagement starts on acceptance).","example":"2026-01-01"},"fiscalYear":{"type":"integer","example":2026},"engagementNameTemplate":{"type":"string","description":"Template the engagement name was generated from","example":"{{fiscal_year.year}} {{letter_template.name}} {{client.number}}"},"createdAt":{"type":"string","format":"date-time","example":"2026-06-08T16:40:09.096612+00:00"},"sentAt":{"type":["string","null"],"format":"date-time","description":"When the engagement was sent. Null until it is sent.","example":"2026-06-08T16:45:00.414069+00:00"},"executedAt":{"type":["string","null"],"format":"date-time","description":"When the engagement was executed. Null until it is executed.","example":"2026-06-08T16:46:48.196882+00:00"},"isStartOnAcceptance":{"type":"boolean","example":true},"updatedAt":{"type":"string","format":"date-time","example":"2026-06-08T16:46:48.199113+00:00"},"paymentInfoType":{"type":"string","enum":["NONE","REQUIRED","OPTIONAL"],"example":"OPTIONAL"},"canceledAt":{"type":["string","null"],"format":"date-time","description":"When the engagement was canceled. Null unless it was canceled.","example":null},"mode":{"type":"string","enum":["AUTOMATIC","MANUAL"],"example":"AUTOMATIC"},"addressContactInfoId":{"type":["integer","null"],"example":null},"originatingEngagementId":{"type":["integer","null"],"description":"Engagement this one was renewed or copied from. Null for an original engagement.","example":null},"clientId":{"type":"integer","example":92},"primaryContactId":{"type":["integer","null"],"description":"Primary contact of the engagement (contact id).","example":311},"secondaryContactId":{"type":["integer","null"],"description":"Secondary contact of the engagement (contact id). Null when none is set.","example":null},"billingContactId":{"type":["integer","null"],"description":"Billing contact of the engagement (contact id). Null when none is set.","example":311},"internalNote":{"type":["string","null"],"description":"Internal note on the engagement, visible only to firm staff.","example":null},"sourceEngagementId":{"type":["integer","null"],"description":"Engagement this one was created from (engagement id). Null when it was not created from another engagement.","example":null},"senderStaffId":{"type":["integer","null"],"description":"Staff member who sends the engagement (staff id).","example":102},"ccStaffIds":{"type":["array","null"],"description":"Engagement collaborators, the staff ids copied on the engagement.","items":{"type":"integer"},"example":[104,105]},"shouldShowToClient":{"type":["boolean","null"],"description":"Whether the engagement is visible to the client.","example":true},"enableAutomaticPayments":{"type":["boolean","null"],"description":"Whether automatic payments are enabled for the engagement.","example":false},"isArchived":{"type":["boolean","null"],"description":"Whether the engagement is archived.","example":false},"reassigned":{"type":"boolean","description":"Whether the engagement has been reassigned.","example":false},"engagement":{"type":["object","null"],"description":"Engagement columns that the engagement view does not carry.","properties":{"pmsRef":{"type":["string","null"],"description":"Identifier of the engagement in the external practice management system.","example":"ENG-2026-85"},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields of the engagement, keyed by custom field code.","example":{"engagement_type":"Recurring"}}}},"jobs":{"type":"array","description":"Active projects (jobs) linked to the engagement","items":{"$ref":"#/components/schemas/EngagementJobLink"}},"partnerStaff":{"$ref":"#/components/schemas/EngagementStaffSummary"},"managerStaff":{"$ref":"#/components/schemas/EngagementStaffSummary"},"createdByStaff":{"$ref":"#/components/schemas/EngagementStaffSummary"},"lastUpdatedByStaff":{"$ref":"#/components/schemas/EngagementStaffSummary"},"executedByStaff":{"anyOf":[{"$ref":"#/components/schemas/EngagementStaffSummary"},{"type":"null"}],"description":"Staff member who executed the engagement. Null until it is executed by a staff member."},"renewedAt":{"type":["string","null"],"format":"date-time","description":"When the engagement was renewed. Null unless it was renewed.","example":null}}}},"components/schemas/AggregateCount":{"id":"components/schemas/AggregateCount","kind":"json-schema","title":"AggregateCount","data":{"type":"object","description":"Standard count aggregation","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of records matching criteria","example":13697}}}}}},"components/schemas/EngagementListResponse":{"id":"components/schemas/EngagementListResponse","kind":"json-schema","title":"EngagementListResponse","data":{"type":"object","description":"Response of the engagement list and search operations","required":["engagements","total"],"properties":{"engagements":{"type":"array","items":{"$ref":"#/components/schemas/Engagement"}},"total":{"$ref":"#/components/schemas/AggregateCount"}}}},"components/schemas/Department":{"id":"components/schemas/Department","kind":"json-schema","title":"Department","data":{"type":"object","description":"Department information","properties":{"id":{"type":"integer","example":7},"pmsRef":{"type":"string","description":"Practice management system reference of the department","example":"TECH"},"name":{"type":"string","example":"Technology"}}}},"components/schemas/StaffOffice":{"id":"components/schemas/StaffOffice","kind":"json-schema","title":"StaffOffice","data":{"type":"object","properties":{"id":{"type":"integer"},"pmsRef":{"type":["string","null"]},"name":{"type":["string","null"]},"city":{"type":["string","null"]},"stateProvince":{"type":["string","null"]},"country":{"type":["string","null"]}}}},"components/schemas/StaffClassification":{"id":"components/schemas/StaffClassification","kind":"json-schema","title":"StaffClassification","data":{"type":"object","description":"Referenced staff classification","properties":{"id":{"type":"integer","example":2},"pmsRef":{"type":["string","null"],"example":"FT"},"name":{"type":["string","null"],"example":"Full Time"}}}},"components/schemas/StaffType":{"id":"components/schemas/StaffType","kind":"json-schema","title":"StaffType","data":{"type":"object","description":"Staff type classification details","properties":{"id":{"type":"integer","example":11},"pmsRef":{"type":["string","null"]},"display":{"type":["string","null"]},"description":{"type":"string","example":"Senior Associate"},"rateCardStaffTypeBillingRates":{"type":"array","description":"Billing rates configured for this role","items":{"type":"object","additionalProperties":true}}}}},"components/schemas/StaffPermissionSet":{"id":"components/schemas/StaffPermissionSet","kind":"json-schema","title":"StaffPermissionSet","data":{"type":"object","description":"Permission set summary","properties":{"id":{"type":"integer","example":3},"name":{"type":"string","example":"Standard Manager"}}}},"components/schemas/StaffMember":{"id":"components/schemas/StaffMember","kind":"json-schema","title":"StaffMember","data":{"type":"object","description":"Staff member basic information","properties":{"id":{"type":"integer","example":53},"pmsRef":{"type":["string","null"],"example":"A53"},"staffRef":{"type":["string","null"],"example":"AH"},"firstName":{"type":"string","example":"Allen"},"lastName":{"type":"string","example":"Hermiston"},"email":{"type":["string","null"],"format":"email","description":"Null for staff without an email address on file.","example":"allen.hermiston@company.com"}}}},"components/schemas/StaffDirectoryRecord":{"id":"components/schemas/StaffDirectoryRecord","kind":"json-schema","title":"StaffDirectoryRecord","data":{"type":"object","description":"Staff directory record with organizational, employment, permission, and reporting relationships","required":["id","pmsRef","staffRef","firstName","lastName","email","active","deptId","jobTitle","jobTitleId","type","officeId","department","office","serviceLine","subServiceLine","wageType","employeeType","role","rateCardBillingRates","staffManagerId","permissionSet","staffSupervisor","updatedAt","createdAt","fullName","prefix","startDt","endDt","staffPartnerId","staffPaId","orgId","isCreatedByAiwyn","isManagedByAiwyn","lastUpdatedByStaffId","customFieldValues"],"properties":{"id":{"type":"integer","example":21},"pmsRef":{"type":["string","null"],"example":"AIWYN_21"},"staffRef":{"type":["string","null"],"example":"AIWYN"},"firstName":{"type":"string","example":"Aiwyn"},"lastName":{"type":"string","example":"User"},"email":{"type":["string","null"],"format":"email","description":"Null for staff without an email address on file.","example":"test@aiwyn.ai"},"active":{"type":"boolean","example":true},"deptId":{"type":["integer","null"]},"jobTitle":{"type":["string","null"]},"jobTitleId":{"type":["integer","null"]},"type":{"type":["string","null"]},"officeId":{"type":["integer","null"]},"department":{"anyOf":[{"$ref":"#/components/schemas/Department"},{"type":"null"}]},"office":{"anyOf":[{"$ref":"#/components/schemas/StaffOffice"},{"type":"null"}]},"serviceLine":{"description":"Primary service line assigned to the staff member","anyOf":[{"$ref":"#/components/schemas/StaffClassification"},{"type":"null"}]},"subServiceLine":{"description":"Sub-service line assigned to the staff member","anyOf":[{"$ref":"#/components/schemas/StaffClassification"},{"type":"null"}]},"wageType":{"description":"Wage classification, such as salary or hourly","anyOf":[{"$ref":"#/components/schemas/StaffClassification"},{"type":"null"}]},"employeeType":{"description":"Employment classification, such as full time or contractor","anyOf":[{"$ref":"#/components/schemas/StaffClassification"},{"type":"null"}]},"role":{"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff role; this response field replaces the former "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"staffType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" field"},"children":[],"type":"text"}],"type":"paragraph"}],"anyOf":[{"$ref":"#/components/schemas/StaffType"},{"type":"null"}]},"permissionSet":{"description":"Permission set assigned directly to the staff member","anyOf":[{"$ref":"#/components/schemas/StaffPermissionSet"},{"type":"null"}]},"staffSupervisor":{"description":"Staff member assigned as this person's supervisor","anyOf":[{"$ref":"#/components/schemas/StaffMember"},{"type":"null"}]},"staffManagerId":{"type":["integer","null"]},"rateCardBillingRates":{"type":"array","items":{"type":"object","additionalProperties":true}},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp of the most recent staff record update","example":"2026-09-21T18:30:00Z"},"createdAt":{"type":"string","format":"date-time","description":"When the record was created.","example":"2024-05-12T22:42:02.719873+00:00"},"fullName":{"type":["string","null"],"description":"Full name.","example":"Aiwyn User"},"prefix":{"type":["string","null"],"description":"Name prefix.","example":"Ms."},"startDt":{"type":["string","null"],"description":"Date the staff member started at the firm, as a local date-time with no time-zone offset.","example":"2024-01-08T00:00:00"},"endDt":{"type":["string","null"],"description":"Date the staff member left the firm, as a local date-time with no time-zone offset.","example":null},"staffPartnerId":{"type":["integer","null"],"description":"Staff id of the partner this staff member reports to."},"staffPaId":{"type":["integer","null"],"description":"Staff id of this staff member's practice administrator."},"orgId":{"type":["integer","null"],"description":"Organization id."},"isCreatedByAiwyn":{"type":"boolean","description":"Whether the record was created in Aiwyn."},"isManagedByAiwyn":{"type":"boolean","description":"Whether Aiwyn manages the record's lifecycle."},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff id of whoever last updated the record."},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields."}}}},"components/schemas/ProjectStaffSummary":{"id":"components/schemas/ProjectStaffSummary","kind":"json-schema","title":"ProjectStaffSummary","data":{"type":"object","description":"Staff member referenced by a project","required":["id","firstName","lastName","email"],"properties":{"id":{"type":"integer","example":102},"firstName":{"type":"string","example":"Allen"},"lastName":{"type":"string","example":"Hermiston"},"email":{"type":["string","null"],"example":"allen.hermiston@company.com"}}}},"components/schemas/Project":{"id":"components/schemas/Project","kind":"json-schema","title":"Project","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project record from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"vw_job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", as returned by the project list, search and by-id"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operations. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"endDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"dueDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" are the same value, and so are "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"targetStartDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" /"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"targetedStartDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"targetEndDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" / "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"targetedEndDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["id","name","startDate","endDate","dueDate","targetStartDate","targetedStartDate","targetEndDate","targetedEndDate","feeStructureId","pmsRef","isCreatedByAiwyn","managerStaffId","partnerStaffId","serviceId","serviceDescription","extendedServiceDescription","status","updatedAt","sysRefs","feeStructureV4","client","projectOwner","partnerStaff","jobServiceLines"],"properties":{"id":{"type":"integer","example":5012},"name":{"type":"string","example":"Q1 Financial Review 2024"},"startDate":{"type":["string","null"],"format":"date-time","description":"Project start date. Null when not set.","example":"2024-01-01T00:00:00Z"},"endDate":{"type":["string","null"],"format":"date-time","description":"Project end date. Null when not set.","example":"2024-03-15T00:00:00Z"},"dueDate":{"type":["string","null"],"format":"date-time","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project due date (same value as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"endDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). Null when not set."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"2024-03-15T00:00:00Z"},"targetStartDate":{"type":["string","null"],"format":"date-time","example":"2023-12-01T00:00:00Z"},"targetedStartDate":{"type":["string","null"],"format":"date-time","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Same value as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"targetStartDate"},"children":[],"type":"code"}],"type":"paragraph"}],"example":"2023-12-01T00:00:00Z"},"targetEndDate":{"type":["string","null"],"format":"date-time","example":"2024-03-31T23:59:59Z"},"targetedEndDate":{"type":["string","null"],"format":"date-time","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Same value as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"targetEndDate"},"children":[],"type":"code"}],"type":"paragraph"}],"example":"2024-03-31T23:59:59Z"},"feeStructureId":{"type":["integer","null"],"example":42},"pmsRef":{"type":"string","example":"JOB-2024-115"},"isCreatedByAiwyn":{"type":"boolean","example":true},"managerStaffId":{"type":["integer","null"],"description":"Project owner (manager) staff id. Null when no owner is assigned.","example":102},"partnerStaffId":{"type":["integer","null"],"description":"Partner staff id. Null when no partner is assigned.","example":101},"serviceId":{"type":["integer","null"],"example":null},"serviceDescription":{"type":["string","null"],"example":"Tax: General Tax Consulting"},"extendedServiceDescription":{"type":["string","null"],"example":null},"status":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project state; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"OPEN"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the project has no status set"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"OPEN"},"createdAt":{"type":"string","format":"date-time","description":"Project record creation timestamp","example":"2024-01-02T09:15:00.000000+00:00"},"updatedAt":{"type":"string","format":"date-time","example":"2024-05-20T12:34:56.123456+00:00"},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Custom field values for the project, keyed by custom field code","example":{"industry_niche":"Manufacturing","naics_code":"333120"}},"sysRefs":{"type":["object","null"],"description":"References of the project in connected systems, keyed by system"},"deptId":{"type":["integer","null"],"description":"Department of the project (department id).","example":7},"officeId":{"type":["integer","null"],"description":"Office of the project (office id).","example":2},"previousProjectId":{"type":["integer","null"],"description":"Previous project in the series (project id).","example":null},"projectContactInfoId":{"type":["integer","null"],"description":"Contact info of the project (contact info id).","example":null},"billable":{"type":["boolean","null"],"description":"Whether the project is billable to the client.","example":true},"draftInvoiceId":{"type":["integer","null"],"description":"Draft invoice of the project (the draft invoice's AR transaction id).","example":null},"defaultBillingDay":{"type":["integer","null"],"description":"Default day of the month the project is billed.","example":1},"projectRef":{"type":["string","null"],"description":"Reference identifier for the project.","example":"J-0005012"},"isManagedByAiwyn":{"type":["boolean","null"],"description":"Whether Aiwyn manages the record's lifecycle.","example":true},"billingDay":{"type":["integer","null"],"description":"Day of the month the project is billed, when it differs from the default.","example":null},"projectTemplateId":{"type":["integer","null"],"description":"Project template the project was created from (job template id).","example":300},"isActive":{"type":"boolean","description":"Whether the record is active.","example":true},"createdByStaffId":{"type":["integer","null"],"description":"Staff member who created the project (staff id).","example":102},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff member who last updated the project (staff id).","example":102},"eFileStates":{"type":["string","null"],"description":"States where returns for the project are filed electronically.","example":"CA,NY"},"paperFileStates":{"type":["string","null"],"description":"States where returns for the project are filed on paper.","example":null},"projectType":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Kind of project, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"JOB"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UNAPPLIED_PROGRESS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"JOB"},"overriddenPreviousProjectId":{"type":["integer","null"],"description":"Overridden previous project (project id).","example":null},"estimationEnabled":{"type":["boolean","null"],"description":"Whether hour estimation is enabled for the project.","example":false},"estimationHours":{"type":["number","null"],"description":"Estimated hours for the project.","example":null},"projectStatusId":{"type":["integer","null"],"description":"Firm-defined project status (project status id).","example":3},"internalNote":{"type":["string","null"],"description":"Internal note on the project, visible only to firm staff.","example":null},"nameTemplate":{"type":["string","null"],"description":"Pattern used to generate the project name.","example":null},"primaryDeliverableTemplateId":{"type":["integer","null"],"description":"Primary deliverable template of the project (deliverable template id).","example":null},"primaryDeliverableId":{"type":["integer","null"],"description":"Primary deliverable of the project (deliverable id).","example":null},"originalTargetEndDate":{"type":["string","null"],"format":"date","description":"Planned end date before any extensions.","example":null},"extensionCount":{"type":["integer","null"],"description":"Number of extensions applied to the project.","example":0},"totalTaskCount":{"type":"integer","description":"Number of tasks on the project.","example":12},"completedTaskCount":{"type":"integer","description":"Number of completed tasks on the project.","example":4},"criToDoCount":{"type":"integer","description":"Number of client request items on the project that are to do.","example":2},"criOpenCount":{"type":"integer","description":"Number of client request items on the project that are open.","example":1},"criInReviewCount":{"type":"integer","description":"Number of client request items on the project that are in review.","example":0},"criRejectedCount":{"type":"integer","description":"Number of client request items on the project that were rejected.","example":0},"criDoneCount":{"type":"integer","description":"Number of client request items on the project that are done.","example":3},"rolloveredTo":{"type":["integer","null"],"description":"Project this one was rolled over to (project id).","example":null},"rolloveredFrom":{"type":["integer","null"],"description":"Project this one was rolled over from (project id).","example":null},"budgetedHours":{"type":"number","description":"Hours budgeted for the project.","example":40},"projectYear":{"type":["integer","null"],"description":"Year the project relates to.","example":2024},"totalClientRequestCount":{"type":"integer","description":"Number of client requests on the project.","example":2},"completedClientRequestCount":{"type":"integer","description":"Number of completed client requests on the project.","example":1},"actualHours":{"type":"number","description":"Hours recorded against the project.","example":12.5},"job":{"type":["object","null"],"description":"Project columns that the project view does not carry.","properties":{"ownerStaffId":{"type":["integer","null"],"description":"Staff member who owns the project (staff id).","example":102}}},"feeStructureV4":{"type":["object","null"],"description":"Fee structure of the project. Null when the project has none.","required":["id","type","amount","active"],"properties":{"id":{"type":"integer","example":1},"type":{"type":"string","example":"FIXED"},"amount":{"type":["number","null"],"example":190},"active":{"type":"boolean","example":true}}},"client":{"type":"object","required":["id","name","clientRef"],"properties":{"id":{"type":"integer","example":2180},"name":{"type":"string","example":"TechFlow Enterprises"},"clientRef":{"type":["string","null"],"example":"TF-2024-789"}}},"projectOwner":{"anyOf":[{"$ref":"#/components/schemas/ProjectStaffSummary"},{"type":"null"}],"description":"Project owner (the manager staff member). Null when no owner is assigned."},"partnerStaff":{"anyOf":[{"$ref":"#/components/schemas/ProjectStaffSummary"},{"type":"null"}],"description":"Partner staff member. Null when no partner is assigned."},"jobServiceLines":{"type":"array","description":"Service lines of the project","items":{"type":"object","required":["id","serviceLineId","active","serviceLine"],"properties":{"id":{"type":"integer","example":1377},"serviceLineId":{"type":"integer","example":5},"active":{"type":"boolean","example":true},"serviceLine":{"type":["object","null"],"required":["id","name","pmsRef"],"properties":{"id":{"type":"integer","example":5},"name":{"type":"string","example":"Tax"},"pmsRef":{"type":["string","null"],"example":"AIWYN_5"}}}}}}}}},"components/schemas/ProjectListResponse":{"id":"components/schemas/ProjectListResponse","kind":"json-schema","title":"ProjectListResponse","data":{"type":"object","description":"Response of the project list and search operations","required":["projects","total"],"properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"total":{"$ref":"#/components/schemas/AggregateCount"}}}},"components/schemas/WebhookDelivery":{"id":"components/schemas/WebhookDelivery","kind":"json-schema","title":"WebhookDelivery","data":{"type":"object","description":"Body of a webhook delivery. One delivery carries one event.","required":["event","subscription"],"properties":{"event":{"type":"object","required":["id","type","entityType","entityId","eventTimestamp","data"],"properties":{"id":{"type":"integer","format":"int64","description":"Event id; the same on every delivery of this event, including retries. The same change can be reported as two events with different ids.","example":7001},"type":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The operation, as listed by the event catalog (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CREATED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"UPDATED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POSTED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"POSTED"},"entityType":{"type":"string","description":"The entity the event is about, as listed by the event catalog.","example":"Payment"},"entityId":{"type":"string","description":"Id of that entity, as a string.","example":"48213"},"eventTimestamp":{"type":"string","format":"date-time","description":"When the event happened.","example":"2026-11-01T18:04:03.517Z"},"data":{"type":"object","description":"The event's content.","properties":{"tenant":{"type":"string","description":"Your firm's tenant identifier.","example":"acmecpa"},"primaryRecord":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The entity as stored when the event fired; null for entity types whose record is not included."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"For "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"File"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" events it is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{eventType, timestamp, file}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", where "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"eventType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"file."},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" plus the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"lowercased operation (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"file.created"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"file"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" carries a signed "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"downloadUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"(absent for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DELETED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"downloadUrlExpiresAt"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"relatedEntitiesData":{"type":["object","null"],"description":"Related records by entity type (each a list), or null when the event has none.","additionalProperties":{"type":"array","items":{}}},"metadata":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Event-specific context. A payment made through a payment link created with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" carries it"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"here as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"paymentLinkMetadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", but only on subscriptions owned by the API key or staff user that"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"created the link; other subscriptions get the event without it. Omitted on "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"File"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" events."},"children":[],"type":"text"}],"type":"paragraph"}]}}}}},"subscription":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","format":"int64","description":"The subscription this delivery is for.","example":9},"description":{"type":["string","null"],"description":"The subscription's description.","example":"Post payments to our ERP"}}}}}},"components/schemas/TransactionType":{"id":"components/schemas/TransactionType","kind":"json-schema","title":"TransactionType","data":{"type":"string","enum":["Receipt","Invoice","Payment","Credit","Adjustment"],"description":"Available AR transaction types"}},"components/schemas/ClientBasic":{"id":"components/schemas/ClientBasic","kind":"json-schema","title":"ClientBasic","data":{"type":"object","description":"Basic client information for relationships","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"TechFlow Enterprises"}}}},"components/schemas/CreditLabel":{"id":"components/schemas/CreditLabel","kind":"json-schema","title":"CreditLabel","data":{"type":"object","description":"Credit label details for categorization","properties":{"id":{"type":"integer","example":3},"name":{"type":"string","example":"Service Credit"},"description":{"type":"string","example":"Credit for service issues or complaints"}}}},"components/schemas/DebitLabel":{"id":"components/schemas/DebitLabel","kind":"json-schema","title":"DebitLabel","data":{"type":"object","description":"Debit label details for categorization","properties":{"id":{"type":"integer","example":2},"name":{"type":"string","example":"Late Fee"},"description":{"type":"string","example":"Late payment penalty charge"},"is_active":{"type":"boolean","example":true}}}},"components/schemas/InvoiceStatus":{"id":"components/schemas/InvoiceStatus","kind":"json-schema","title":"InvoiceStatus","data":{"type":"string","enum":["PENDING","POSTED","PAID","OVERDUE","CANCELLED","DRAFT"],"description":"Available invoice statuses"}},"components/schemas/ARTransactionBasic":{"id":"components/schemas/ARTransactionBasic","kind":"json-schema","title":"ARTransactionBasic","data":{"type":"object","description":"Basic AR transaction details for invoice relationships","properties":{"id":{"type":"integer","example":125890},"pmsRef":{"type":"string","description":"Practice management system reference","example":"240815"},"transactionDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Transaction date, as a local date-time with no time-zone offset","example":"2024-03-22T05:00:00"},"amount":{"type":"number","format":"decimal","description":"Transaction amount as a decimal, USD","example":4250},"allocated":{"type":"number","format":"decimal","description":"Allocated amount as a decimal, USD","example":4250},"clientId":{"type":"integer","description":"Client identifier","example":7720},"client":{"$ref":"#/components/schemas/ClientBasic"}}}},"components/schemas/PaymentMethod":{"id":"components/schemas/PaymentMethod","kind":"json-schema","title":"PaymentMethod","data":{"type":"string","enum":["CREDIT_CARD","DEBIT_CARD","ACH","BANK_TRANSFER","CHECK","WIRE","PAYPAL","APPLE_PAY","GOOGLE_PAY"],"description":"Available payment methods"}},"components/schemas/PaymentStatus":{"id":"components/schemas/PaymentStatus","kind":"json-schema","title":"PaymentStatus","data":{"type":"string","enum":["PENDING","CONFIRMED","FAILED","CANCELLED","REFUNDED"],"description":"Available payment statuses"}},"components/schemas/ClientWithRef":{"id":"components/schemas/ClientWithRef","kind":"json-schema","title":"ClientWithRef","data":{"type":"object","description":"Client information with reference number","properties":{"id":{"type":"integer","example":789},"name":{"type":"string","example":"TechFlow Enterprises"},"clientRef":{"type":"string","example":"TF-2024-789"}}}},"components/schemas/WIPType":{"id":"components/schemas/WIPType","kind":"json-schema","title":"WIPType","data":{"type":"string","enum":["Time","Expense","Fixed_Fee","Disbursement"],"description":"Available WIP types"}},"components/schemas/Job":{"id":"components/schemas/Job","kind":"json-schema","title":"Job","data":{"type":"object","description":"Job information for WIP tracking","required":["id","name"],"properties":{"id":{"type":"integer","example":2514},"name":{"type":"string","example":"Q1 Financial Review 2024"}}}},"components/schemas/PaginationRequest":{"id":"components/schemas/PaginationRequest","kind":"json-schema","title":"PaginationRequest","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit/offset pagination for list and search endpoints. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is a limit"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an offset (records to skip), not a page index."},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":"Limit, the number of records to return (not a page count).","example":25},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset, the number of records to skip. This is not a page index. To fetch the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0}}}},"components/schemas/ARTransaction":{"id":"components/schemas/ARTransaction","kind":"json-schema","title":"ARTransaction","data":{"type":"object","description":"Accounts receivable transaction record","properties":{"id":{"type":"integer","description":"Unique transaction identifier","example":125001},"pmsRef":{"type":"string","description":"Practice management system reference number","example":"240815"},"type":{"allOf":[{"$ref":"#/components/schemas/TransactionType"}],"description":"Transaction type classification"},"transactionDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Date when transaction occurred, as a local date-time with no time-zone offset","example":"2024-02-15T05:00:00"},"amount":{"type":"number","format":"decimal","description":"Transaction amount as a decimal, USD (negative for receipts/credits)","example":-1250},"allocated":{"type":"number","format":"decimal","description":"Amount allocated/applied to invoices, as a decimal, USD","example":-1250},"notes":{"type":"string","description":"Additional transaction notes or comments","example":null},"clientId":{"type":"integer","description":"Associated client identifier","example":1},"createdAt":{"type":"string","format":"date-time","description":"Record creation timestamp","example":"2024-05-12T22:50:18.418236+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Record last update timestamp","example":"2024-05-12T22:50:18.418236+00:00"},"client":{"$ref":"#/components/schemas/ClientBasic"}}}},"components/schemas/AggregateCountSum":{"id":"components/schemas/AggregateCountSum","kind":"json-schema","title":"AggregateCountSum","data":{"type":"object","description":"Count and sum aggregation for financial data","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of records matching criteria","example":48},"sum":{"type":"object","properties":{"amount":{"type":"number","format":"decimal","description":"Sum of amounts","example":-52750},"allocated":{"type":"number","format":"decimal","description":"Sum of allocated amounts","example":-52750}}}}}}}},"components/schemas/Credit":{"id":"components/schemas/Credit","kind":"json-schema","title":"Credit","data":{"type":"object","description":"Credit entry with categorization","properties":{"ar_tran_id":{"type":"integer","description":"Associated AR transaction identifier","example":125890},"is_partial":{"type":"boolean","description":"Whether this is a partial credit (true) or full credit (false)","example":false},"credit_label_id":{"type":"integer","description":"Reference to credit categorization label","example":3},"created_at":{"type":"string","format":"date-time","description":"Credit record creation timestamp","example":"2024-05-12T22:50:21.31979+00:00"},"updated_at":{"type":"string","format":"date-time","description":"Credit record last update timestamp","example":"2024-05-12T22:50:21.31979+00:00"},"creditLabel":{"$ref":"#/components/schemas/CreditLabel"}}}},"components/schemas/Debit":{"id":"components/schemas/Debit","kind":"json-schema","title":"Debit","data":{"type":"object","description":"Debit entry with categorization and staff tracking","properties":{"ar_tran_id":{"type":"integer","description":"Associated AR transaction identifier","example":125890},"debit_label_id":{"type":"integer","description":"Reference to debit categorization label","example":2},"created_at":{"type":"string","format":"date-time","description":"Debit record creation timestamp","example":"2024-05-12T22:50:21.31979+00:00"},"updated_at":{"type":"string","format":"date-time","description":"Debit record last update timestamp","example":"2024-05-12T22:50:21.31979+00:00"},"created_by_staff_id":{"type":"integer","description":"ID of staff member who created the debit","example":15},"last_updated_by_staff_id":{"type":"integer","description":"ID of staff member who last updated the debit","example":15},"custom_field_values":{"type":"object","description":"Additional custom field data in JSON format","example":{"reason":"Late payment fee","approved_by":"manager"}},"debitLabel":{"$ref":"#/components/schemas/DebitLabel"},"createdByStaff":{"$ref":"#/components/schemas/StaffMember"},"lastUpdatedByStaff":{"$ref":"#/components/schemas/StaffMember"}}}},"components/schemas/Invoice":{"id":"components/schemas/Invoice","kind":"json-schema","title":"Invoice","data":{"type":"object","description":"Invoice record with AR transaction details","required":["arTranId","invoiceNumber","status","createdAt","updatedAt"],"properties":{"arTranId":{"type":"integer","description":"Associated AR transaction identifier","example":125890},"invoiceNumber":{"type":"string","description":"Unique invoice number for client reference","example":"INV-2024-4850"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Invoice payment due date, as a local date-time with no time-zone offset","example":"2024-04-24T05:00:00"},"status":{"allOf":[{"$ref":"#/components/schemas/InvoiceStatus"}],"description":"Current invoice status"},"tax":{"type":"number","format":"decimal","description":"Tax amount charged on invoice, as a decimal, USD","example":0},"interest":{"type":"number","format":"decimal","description":"Interest charges applied to invoice, as a decimal, USD","example":0},"description":{"type":"string","description":"Additional invoice description or notes","example":null},"createdAt":{"type":"string","format":"date-time","description":"Invoice record creation timestamp","example":"2024-05-12T22:50:20.595961+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Invoice record last update timestamp","example":"2024-05-12T22:50:20.595961+00:00"},"ar_tran":{"$ref":"#/components/schemas/ARTransactionBasic"}}}},"components/schemas/Payment":{"id":"components/schemas/Payment","kind":"json-schema","title":"Payment","data":{"type":"object","description":"Payment record with security compliance","required":["id","arTranId","amount","status","createdAt","updatedAt"],"properties":{"id":{"type":"integer","description":"Unique payment identifier","example":45201},"arTranId":{"type":"integer","description":"Associated AR transaction identifier","example":125890},"paymentMethod":{"allOf":[{"$ref":"#/components/schemas/PaymentMethod"}],"description":"Payment method type"},"amount":{"type":"number","format":"decimal","description":"Payment amount as a decimal, USD","example":2750},"paymentDate":{"type":"string","format":"date-time","description":"Date when payment was processed","example":"2024-03-15T14:30:22+00:00"},"confirmationDate":{"type":"string","format":"date-time","description":"Date when payment was confirmed","example":"2024-03-15T14:32:18+00:00"},"status":{"allOf":[{"$ref":"#/components/schemas/PaymentStatus"}],"description":"Current payment status"},"processorId":{"type":"string","description":"Payment processor identifier","example":"stripe"},"processorReferenceId":{"type":"string","description":"Payment processor transaction reference","example":"pi_3N1K2mL4uZ5v6w7x8y9z0a1b"},"last4Digits":{"type":"string","description":"Last 4 digits of card (PCI compliant)","example":"4242"},"cardType":{"type":"string","description":"Credit card type","example":"VISA"},"currency":{"type":"string","description":"Payment currency code","example":"USD"},"clientId":{"type":"integer","description":"Associated client identifier","example":789},"createdAt":{"type":"string","format":"date-time","description":"Payment record creation timestamp","example":"2024-03-15T14:30:22.123456+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Payment record last update timestamp","example":"2024-03-15T14:32:18.789012+00:00"},"client":{"$ref":"#/components/schemas/ClientWithRef"},"ar_tran":{"$ref":"#/components/schemas/ARTransactionBasic"}}}},"components/schemas/WIP":{"id":"components/schemas/WIP","kind":"json-schema","title":"WIP","data":{"type":"object","description":"Work in Progress record with financial tracking","required":["id","wipType","clientId","createdAt","updatedAt"],"properties":{"id":{"type":"integer","description":"Unique WIP record identifier","example":850321},"pmsRef":{"type":"string","description":"Practice management system reference","example":"1789456"},"wipType":{"allOf":[{"$ref":"#/components/schemas/WIPType"}],"description":"Type of WIP entry"},"loggedDate":{"type":"string","format":"date-time","description":"Date when WIP was logged","example":"2024-01-17T05:00:00"},"wipValue":{"type":"number","format":"decimal","description":"Original WIP value recorded, as a decimal, USD","example":1250},"wipValueOutstanding":{"type":"number","format":"decimal","description":"Outstanding WIP value yet to be billed, as a decimal, USD","example":0},"billedAmount":{"type":"number","format":"decimal","description":"Amount that has been billed from this WIP, as a decimal, USD","example":1225},"writeOffAmount":{"type":"number","format":"decimal","description":"Amount written off as uncollectible, as a decimal, USD","example":25},"notes":{"type":"string","description":"Additional notes or description for the WIP entry","example":"Consultation and analysis for Q1 financial review"},"clientId":{"type":["integer","null"],"description":"Associated client identifier. Null when the entry is not linked to a client.","example":1561},"jobId":{"type":["integer","null"],"description":"Associated job identifier. Null when the entry is not linked to a job, as is usual for an expense.","example":2514},"createdAt":{"type":"string","format":"date-time","description":"WIP record creation timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"WIP record last update timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"client":{"$ref":"#/components/schemas/ClientBasic"},"job":{"$ref":"#/components/schemas/Job"}}}},"components/schemas/WIPAggregate":{"id":"components/schemas/WIPAggregate","kind":"json-schema","title":"WIPAggregate","data":{"type":"object","description":"WIP-specific aggregation with financial summaries","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of WIP records","example":84},"sum":{"type":"object","properties":{"wipValue":{"type":"number","format":"decimal","description":"Total WIP value","example":24186.15},"billedAmount":{"type":"number","format":"decimal","description":"Total billed amount","example":19612.07},"wipValueOutstanding":{"type":"number","format":"decimal","description":"Total outstanding WIP value","example":125}}}}}}}},"components/schemas/StaffUserTask":{"id":"components/schemas/StaffUserTask","kind":"json-schema","title":"StaffUserTask","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Staff user task from vw_my_task with task type and job info"},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"id":{"type":"integer","example":88015},"taskType":{"type":"object","properties":{"code":{"type":"string","example":"BILLABLE"},"id":{"type":"integer","example":12},"display":{"type":"string","example":"Billable Work"},"billable":{"type":"boolean","example":true},"updatedAt":{"type":"string","format":"date-time","example":"2024-05-10T09:10:11.000000+00:00"},"createdAt":{"type":"string","format":"date-time","example":"2023-05-10T09:10:11.000000+00:00"},"isManagedByAiwyn":{"type":"boolean","example":true},"rate_type":{"type":"object","properties":{"id":{"type":"integer","example":3},"name":{"type":"string","example":"Hourly"},"createdAt":{"type":"string","format":"date-time","example":"2020-01-01T00:00:00+00:00"},"updatedAt":{"type":"string","format":"date-time","example":"2020-01-01T00:00:00+00:00"}}},"task_type_category":{"type":"object","properties":{"id":{"type":"integer","example":2},"name":{"type":"string","example":"Consulting"},"description":{"type":"string","example":"Client-facing consulting tasks"},"associatedTaskTypes":{"type":"array","items":{"type":"integer"},"example":[11,12,13]},"createdAt":{"type":"string","format":"date-time","example":"2020-01-01T00:00:00+00:00"},"updatedAt":{"type":"string","format":"date-time","example":"2020-01-01T00:00:00+00:00"}}},"job_templates":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","example":5}}}}}}},"job":{"type":"object","description":"Project information for the task","properties":{"id":{"type":"integer","example":5012},"name":{"type":"string","example":"Q1 Financial Review 2024"},"client":{"type":"object","properties":{"id":{"type":"integer","example":2180},"name":{"type":"string","example":"TechFlow Enterprises"},"clientRef":{"type":"string","example":"TF-2024-789"}}}}}}}},"components/schemas/Address":{"id":"components/schemas/Address","kind":"json-schema","title":"Address","data":{"type":"object","description":"Reusable postal address block","properties":{"address":{"type":"string","description":"Street address","example":"123 Main Street"},"city":{"type":"string","description":"City","example":"Anytown"},"state":{"type":"string","description":"State or province code","example":"CA"},"zip_code":{"type":"string","description":"Postal / ZIP code","example":"12345"}}}},"components/schemas/StaffComplete":{"id":"components/schemas/StaffComplete","kind":"json-schema","title":"StaffComplete","data":{"type":"object","description":"Complete staff record with department and type information","required":["id","firstName","lastName","active","createdAt","updatedAt"],"properties":{"id":{"type":"integer","description":"Unique staff identifier","example":301},"pmsRef":{"type":"string","description":"Practice management system reference","example":"2650"},"staffRef":{"type":"string","description":"Staff reference code or initials","example":"JDM"},"firstName":{"type":"string","description":"Employee first name","example":"Sarah"},"lastName":{"type":"string","description":"Employee last name","example":"Johnson"},"email":{"type":["string","null"],"format":"email","description":"Employee email address. Null for staff without an email address on file.","example":"sarah.johnson@company.com"},"active":{"type":"boolean","description":"Employee active status","example":true},"deptId":{"type":"integer","description":"Department identifier","example":7},"staffTypeId":{"type":"integer","description":"Staff type classification identifier","example":11},"createdAt":{"type":"string","format":"date-time","description":"Staff record creation timestamp","example":"2024-05-12T22:42:02.719873+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Staff record last update timestamp","example":"2024-05-12T22:42:05.487898+00:00"},"department":{"$ref":"#/components/schemas/Department"},"staff_type":{"$ref":"#/components/schemas/StaffType"}}}},"components/schemas/FilterRequest":{"id":"components/schemas/FilterRequest","kind":"json-schema","title":"FilterRequest","data":{"allOf":[{"$ref":"#/components/schemas/PaginationRequest"},{"type":"object","properties":{"where":{"type":"object","description":"Boolean expression for filtering","additionalProperties":true,"example":{"_and":[{"active":{"_eq":true}},{"name":{"_ilike":"%searchterm%"}}]}},"orderBy":{"type":"array","description":"Array of sorting criteria","items":{"type":"object","additionalProperties":true},"example":[{"name":"asc"},{"createdAt":"desc"}]}}}]}},"components/schemas/ClientListResponse":{"id":"components/schemas/ClientListResponse","kind":"json-schema","title":"ClientListResponse","data":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Response of "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/clients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/clients/search"},"children":[],"type":"code"}],"type":"paragraph"}],"required":["clients","total"],"properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"total":{"$ref":"#/components/schemas/AggregateCount"}}}},"components/schemas/ARTransactionListResponse":{"id":"components/schemas/ARTransactionListResponse","kind":"json-schema","title":"ARTransactionListResponse","data":{"type":"object","description":"Standard response format for AR transaction endpoints","properties":{"deid_ar_tran":{"type":"array","items":{"$ref":"#/components/schemas/ARTransaction"}},"deid_ar_tran_aggregate":{"$ref":"#/components/schemas/AggregateCountSum"}}}},"components/schemas/CreditListResponse":{"id":"components/schemas/CreditListResponse","kind":"json-schema","title":"CreditListResponse","data":{"type":"object","description":"Standard response format for credit endpoints","properties":{"deid_credit":{"type":"array","items":{"$ref":"#/components/schemas/Credit"}},"deid_credit_aggregate":{"$ref":"#/components/schemas/AggregateCount"}}}},"components/schemas/DebitListResponse":{"id":"components/schemas/DebitListResponse","kind":"json-schema","title":"DebitListResponse","data":{"type":"object","description":"Standard response format for debit endpoints","properties":{"deid_debit":{"type":"array","items":{"$ref":"#/components/schemas/Debit"}},"deid_debit_aggregate":{"$ref":"#/components/schemas/AggregateCount"}}}},"components/schemas/InvoiceListResponse":{"id":"components/schemas/InvoiceListResponse","kind":"json-schema","title":"InvoiceListResponse","data":{"type":"object","description":"Standard response format for invoice endpoints","properties":{"deid_invoice":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"deid_invoice_aggregate":{"$ref":"#/components/schemas/AggregateCount"}}}},"components/schemas/PaymentListResponse":{"id":"components/schemas/PaymentListResponse","kind":"json-schema","title":"PaymentListResponse","data":{"type":"object","description":"Standard response format for payment endpoints","properties":{"deid_payment":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"deid_payment_aggregate":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","example":15},"sum":{"type":"object","properties":{"amount":{"type":"number","format":"decimal","description":"Total payment amount","example":28750}}}}}}}}}},"components/schemas/StaffListResponse":{"id":"components/schemas/StaffListResponse","kind":"json-schema","title":"StaffListResponse","data":{"type":"object","description":"Standard response format for staff endpoints","properties":{"staff":{"type":"array","items":{"$ref":"#/components/schemas/StaffDirectoryRecord"}},"total":{"$ref":"#/components/schemas/AggregateCount"}}}},"components/schemas/WIPListResponse":{"id":"components/schemas/WIPListResponse","kind":"json-schema","title":"WIPListResponse","data":{"type":"object","description":"Standard response format for WIP endpoints","properties":{"deid_wip":{"type":"array","items":{"$ref":"#/components/schemas/WIP"}},"deid_wip_aggregate":{"$ref":"#/components/schemas/WIPAggregate"}}}},"components/schemas/EngagementStatus":{"id":"components/schemas/EngagementStatus","kind":"json-schema","title":"EngagementStatus","data":{"type":"string","enum":["DRAFT","IN_REVIEW","IN_APPROVAL","READY_TO_SEND","SENT","UNDER_REVISION","EXECUTED","CANCELED","ARCHIVED"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Stored engagement statuses. Read operations report an engagement in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"IN_REVIEW"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" with the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"name of its current workflow step instead."},"children":[],"type":"text"}],"type":"paragraph"}]}},"components/schemas/SortOrder":{"id":"components/schemas/SortOrder","kind":"json-schema","title":"SortOrder","data":{"type":"string","enum":["asc","desc"],"description":"Sort order options"}},"components/schemas/StaffUserTaskListResponse":{"id":"components/schemas/StaffUserTaskListResponse","kind":"json-schema","title":"StaffUserTaskListResponse","data":{"type":"object","description":"Standard response format for staff user task endpoints","properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/StaffUserTask"}},"total":{"$ref":"#/components/schemas/AggregateCount"}}}},"schema_0":{"kind":"json-schema","data":{"type":"object","properties":{"jwtApiKey":{"type":"string","description":"JWT API key obtained from Aiwyn Support."}},"required":["jwtApiKey"]},"id":"schema_0"},"schema_1":{"kind":"json-schema","data":{"type":"object","properties":{"token":{"type":"string","description":"Bearer JWT for accessing Product APIs."}}},"id":"schema_1"},"schema_2":{"kind":"json-schema","data":{"type":"object","required":["message","extensions"],"properties":{"message":{"type":"string","example":"Invalid request body. Please ensure your JSON is properly formatted and contains valid values."},"extensions":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"The HTTP status code.","example":400},"details":{"type":["object","null"],"properties":{"reason":{"type":"string","example":"INVALID_REQUEST_BODY"}}}}}}},"id":"schema_2"},"schema_3":{"kind":"json-schema","data":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"A generic, human-readable sentence."}}}]},"id":"schema_3"},"schema_4":{"kind":"json-schema","data":{"type":"object","properties":{"Retry-After":{"type":"integer","example":120,"description":"Seconds to wait before requesting a new token."}}},"id":"schema_4"},"schema_5":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count)."},"children":[],"type":"text"}],"type":"paragraph"}],"example":1000},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next 1,000 rows after the first 1,000, send"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: 1000"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: 1000"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns an empty "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0}}},"id":"schema_5"},"schema_6":{"kind":"json-schema","data":{"type":"object","required":["clients","total"],"properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","description":"Total number of clients in the system","example":13697}}}}}}},"id":"schema_6"},"schema_7":{"kind":"json-schema","data":{"type":"object","properties":{"error":{"type":"string"}}},"id":"schema_7"},"schema_8":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Defaults to 50 when omitted."},"children":[],"type":"text"}],"type":"paragraph"}],"example":1},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Same contract as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/clients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". When "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is at or"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clients"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is an empty array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0},"where":{"type":"object","description":"Flexible where clause for complex filtering","example":{"_and":[{"_or":[{"name":{"_ilike":"%tech%"}},{"clientRef":{"_ilike":"%45%"}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"partnerStaffId":{"_in":[5,6,7,8]}}]}},"orderBy":{"type":"array","description":"Dynamic ordering specifications with multiple fields","items":{"type":"object"},"example":[{"name":"asc"},{"createdAt":"desc"}]}}},"id":"schema_8"},"schema_9":{"kind":"json-schema","data":{"type":"object","required":["clients","total"],"properties":{"clients":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Same client shape as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /gql/v1/clients"},"children":[],"type":"code"}],"type":"paragraph"}],"items":{"$ref":"#/components/schemas/Client"}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","description":"Total number of clients matching filter criteria","example":59}}}}}}},"id":"schema_9"},"schema_10":{"kind":"json-schema","data":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}},"id":"schema_10"},"schema_11":{"kind":"json-schema","data":{"type":"integer","minimum":1},"id":"schema_11"},"schema_12":{"kind":"json-schema","data":{"type":"object","required":["client"],"properties":{"client":{"anyOf":[{"$ref":"#/components/schemas/ClientDetail"},{"type":"null"}]}}},"id":"schema_12"},"schema_13":{"kind":"json-schema","data":{"type":"object","properties":{"code":{"type":"string"},"error":{"type":"string"},"path":{"type":"string"}}},"id":"schema_13"},"schema_14":{"kind":"json-schema","data":{"type":"object","required":["name","pmsRef","clientRef","officeId"],"properties":{"name":{"type":"string","description":"Client display name","example":"Acme Corporation"},"pmsRef":{"type":"string","description":"Practice management system reference identifier","example":"ACME-001"},"clientRef":{"type":"string","description":"Unique client reference identifier","example":"ACME-001"},"officeId":{"type":"integer","format":"int64","description":"ID of the office this client belongs to","example":1},"description":{"type":["string","null"],"description":"Optional client description","example":"A multinational technology company"},"sortName":{"type":["string","null"],"description":"Alternate name used for alphabetical sorting","example":"Acme"},"notes":{"type":["string","null"],"description":"Internal notes about the client","example":"Preferred billing on the 1st of the month"},"departmentId":{"type":["integer","null"],"format":"int64","description":"ID of the department associated with this client","example":10},"orgId":{"type":["integer","null"],"format":"int64","description":"ID of the organization associated with this client","example":5},"industryId":{"type":["integer","null"],"format":"int64","description":"ID of the industry classification for this client","example":3},"partnerStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the partner staff member assigned to this client","example":53},"managerStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the manager staff member assigned to this client","example":15},"clientTypeId":{"type":["integer","null"],"format":"int64","description":"ID of the client type classification","example":7},"clientBusinessEntityId":{"type":["integer","null"],"format":"int64","description":"ID of the client business entity (entity type)","example":4},"staffBillingManagerId":{"type":["integer","null"],"format":"int64","description":"ID of the staff member acting as billing manager for this client","example":22},"fiscalYearEndMonth":{"type":["integer","null"],"format":"int32","minimum":1,"maximum":12,"description":"Month (1-12) the client's fiscal year ends","example":12},"fiscalYearEndDay":{"type":["integer","null"],"format":"int32","minimum":1,"maximum":31,"description":"Day of month (1-31) the client's fiscal year ends","example":31},"customFieldValuesJson":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"JSON object, encoded as a string, mapping custom field keys to values. Keys not defined in the tenant's CLIENT custom-field schema, and keys of read-only or hidden fields, are ignored and reported back in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.ignoredCustomFields"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"{\"industry_niche\":\"Manufacturing\",\"naics_code\":\"333120\"}"},"taxRegionIds":{"type":["array","null"],"description":"IDs of existing tax regions to assign to the new client. Duplicates are de-duplicated; an unknown ID returns 400.\n","items":{"type":"integer","format":"int64"},"example":[3,7]},"ebilling":{"type":"boolean","default":false,"description":"Whether this client is enrolled in electronic billing","example":true},"invoiceDeliveryMethod":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How invoices are delivered to the client. Defaults to EMAIL when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ebilling"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is true, otherwise DOWNLOAD."},"children":[],"type":"text"}],"type":"paragraph"}],"enum":["EMAIL","DOWNLOAD","EMAIL_AND_DOWNLOAD","POST_ONLY",null],"example":"EMAIL"},"emailStatement":{"type":"boolean","default":false,"description":"Whether statements are emailed to the client","example":false},"chargeAdminFee":{"type":"boolean","default":false,"description":"Whether an administrative fee is charged to this client","example":false},"active":{"type":"boolean","default":true,"description":"Whether the client is active","example":true},"address":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The client's own address, stored as the client's contact info record (the portal's \"Address\" section). At least one address field is required; "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is optional and generated as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"AIWYN_<uuid>"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when omitted."},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"pmsRef":{"type":["string","null"],"description":"PMS reference for the address record. Must not already exist.","example":"ACME-001-ADDRESS"},"address":{"type":["string","null"],"example":"123 Main St"},"address2":{"type":["string","null"],"example":"Suite 400"},"city":{"type":["string","null"],"example":"Charlotte"},"state":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"For "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"country: US"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" a US state name or abbreviation, stored as the abbreviation. Free text for other countries."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"NC"},"country":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code; stored upper-case.","example":"US"},"zipCode":{"type":["string","null"],"example":"28202"}}},"billingAddress":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billing address, stored as a client address of type Billing (the portal's \"Billing Address\" section). Same shape and rules as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"address"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"pmsRef":{"type":["string","null"],"description":"PMS reference for the billing address record. Must not already exist.","example":"ACME-001-BILLING"},"address":{"type":["string","null"],"example":"PO Box 999"},"address2":{"type":["string","null"],"example":null},"city":{"type":["string","null"],"example":"Raleigh"},"state":{"type":["string","null"],"example":"NC"},"country":{"type":["string","null"],"example":"US"},"zipCode":{"type":["string","null"],"example":"27601"}}},"prefContact":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Preferred contact. Provide either "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (existing contact) or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contactInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (create new) — not both. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pmsRef"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is required when creating a new contact."},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"id":{"type":["integer","null"],"format":"int64","description":"ID of an existing contact to link","example":501},"username":{"type":["string","null"],"format":"email","description":"Email address used as the contact's login username","example":"jane.smith@acme.com"},"pmsRef":{"type":["string","null"],"description":"PMS reference for the contact. Required when creating a new contact.","example":"CONT-001"},"type":{"type":["string","null"],"description":"Contact type classification","example":"PRIMARY"},"staffId":{"type":["integer","null"],"format":"int64","description":"ID of the staff member associated with this contact","example":53},"officeId":{"type":["integer","null"],"format":"int64","description":"ID of the office associated with this contact","example":1},"contactInfo":{"type":["object","null"],"description":"Full contact details for creating a new contact record","required":["pmsRef"],"properties":{"pmsRef":{"type":"string","description":"PMS reference for the contact info record","example":"CONT-001"},"shortName":{"type":["string","null"],"example":"Jane S."},"firstName":{"type":["string","null"],"example":"Jane"},"lastName":{"type":["string","null"],"example":"Smith"},"jobTitle":{"type":["string","null"],"example":"CFO"},"prefix":{"type":["string","null"],"example":"Ms."},"salutation":{"type":["string","null"],"example":"Dear Jane"},"phone":{"type":["string","null"],"example":"+1-555-0123"},"email":{"type":["string","null"],"format":"email","example":"jane.smith@acme.com"},"address":{"type":["string","null"],"example":"123 Main St"},"address2":{"type":["string","null"],"example":"Suite 400"},"city":{"type":["string","null"],"example":"New York"},"state":{"type":["string","null"],"example":"NY"},"country":{"type":["string","null"],"example":"US"},"zipCode":{"type":["string","null"],"example":"10001"}}}}},"billingContact":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Billing contact. Same shape as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"prefContact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — provide either "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contactInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"id":{"type":["integer","null"],"format":"int64","example":502},"username":{"type":["string","null"],"format":"email","example":"billing@acme.com"},"pmsRef":{"type":["string","null"],"example":"CONT-002"},"type":{"type":["string","null"],"example":"BILLING"},"staffId":{"type":["integer","null"],"format":"int64","example":null},"officeId":{"type":["integer","null"],"format":"int64","example":1},"contactInfo":{"type":["object","null"],"required":["pmsRef"],"properties":{"pmsRef":{"type":"string","example":"CONT-002"},"shortName":{"type":["string","null"],"example":null},"firstName":{"type":["string","null"],"example":"Bob"},"lastName":{"type":["string","null"],"example":"Finance"},"jobTitle":{"type":["string","null"],"example":"Accounts Payable"},"prefix":{"type":["string","null"],"example":null},"salutation":{"type":["string","null"],"example":null},"phone":{"type":["string","null"],"example":"+1-555-0124"},"email":{"type":["string","null"],"format":"email","example":"billing@acme.com"},"address":{"type":["string","null"],"example":null},"address2":{"type":["string","null"],"example":null},"city":{"type":["string","null"],"example":null},"state":{"type":["string","null"],"example":null},"country":{"type":["string","null"],"example":null},"zipCode":{"type":["string","null"],"example":null}}}}},"secondaryContact":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Secondary contact. Same shape as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"prefContact"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" — provide either "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"contactInfo"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"id":{"type":["integer","null"],"format":"int64","example":503},"username":{"type":["string","null"],"format":"email","example":null},"pmsRef":{"type":["string","null"],"example":null},"type":{"type":["string","null"],"example":null},"staffId":{"type":["integer","null"],"format":"int64","example":null},"officeId":{"type":["integer","null"],"format":"int64","example":null},"contactInfo":{"type":["object","null"],"required":["pmsRef"],"properties":{"pmsRef":{"type":"string","example":"CONT-003"},"firstName":{"type":["string","null"],"example":"Carol"},"lastName":{"type":["string","null"],"example":"Secondary"},"email":{"type":["string","null"],"format":"email","example":"carol@acme.com"}}}}}}},"id":"schema_14"},"schema_15":{"kind":"json-schema","data":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","required":["client"],"properties":{"client":{"type":"object","description":"The newly created client record","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the created client","example":1001},"pmsRef":{"type":"string","example":"ACME-001"},"clientRef":{"type":"string","example":"ACME-001"},"name":{"type":"string","example":"Acme Corporation"},"description":{"type":["string","null"],"example":null},"sortName":{"type":["string","null"],"example":null},"officeId":{"type":"integer","format":"int64","example":1},"departmentId":{"type":["integer","null"],"format":"int64","example":null},"orgId":{"type":["integer","null"],"format":"int64","example":null},"industryId":{"type":["integer","null"],"format":"int64","example":null},"partnerStaffId":{"type":["integer","null"],"format":"int64","example":53},"managerStaffId":{"type":["integer","null"],"format":"int64","example":15},"clientTypeId":{"type":["integer","null"],"format":"int64","example":7},"clientBusinessEntityId":{"type":["integer","null"],"format":"int64","example":4},"staffBillingManagerId":{"type":["integer","null"],"format":"int64","example":22},"fiscalYearEndMonth":{"type":["integer","null"],"format":"int32","example":12},"fiscalYearEndDay":{"type":["integer","null"],"format":"int32","example":31},"customFieldValuesJson":{"type":["string","null"],"description":"JSON object, encoded as a string, of persisted custom field values","example":"{\"industry_niche\":\"Manufacturing\"}"},"active":{"type":"boolean","example":true},"status":{"type":"string","example":"ACTIVE"},"version":{"type":"integer","format":"int64","example":1},"createdAt":{"type":["string","null"],"format":"date-time","example":"2024-03-15T10:00:00Z"},"updatedAt":{"type":["string","null"],"format":"date-time","example":"2024-03-15T10:00:00Z"}}},"prefContactId":{"type":["integer","null"],"format":"int64","description":"ID of the resolved preferred contact","example":601},"billingContactId":{"type":["integer","null"],"format":"int64","description":"ID of the resolved billing contact","example":null},"secondaryContactId":{"type":["integer","null"],"format":"int64","description":"ID of the resolved secondary contact","example":null},"clientContactInfoId":{"type":["integer","null"],"format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ID of the contact info record created from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"address"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; null when no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"address"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" was supplied"},"children":[],"type":"text"}],"type":"paragraph"}],"example":44489},"billingAddressId":{"type":["integer","null"],"format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ID of the Billing client address created from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingAddress"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; null when no "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"billingAddress"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" was supplied"},"children":[],"type":"text"}],"type":"paragraph"}],"example":211},"taxRegionIds":{"type":"array","description":"IDs of the tax regions assigned to the client during onboarding","items":{"type":"integer","format":"int64"},"example":[3,7]},"ignoredCustomFields":{"type":"array","description":"Custom field keys that were provided but ignored because they are not defined in the tenant's CLIENT custom-field schema\n","items":{"type":"string"},"example":[]}}},"meta":{"type":"object","required":["success","message","timestamp"],"properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Success message. When custom field keys are dropped, this is suffixed with \"; ignored unknown or protected custom fields: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{keys}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"Client onboarded successfully"},"timestamp":{"type":"string","format":"date-time","example":"2024-03-15T10:00:00.123Z"},"version":{"type":"string","example":"v1"}}}}},"id":"schema_15"},"schema_16":{"kind":"json-schema","data":{"anyOf":[{"type":"object","description":"Global ART error","required":["message","extensions"],"properties":{"message":{"type":"string"},"extensions":{"type":"object","properties":{"code":{"type":"integer"},"details":{"type":"object"}}}}},{"type":"object","description":"Onboarding rule rejected the request","required":["error","meta"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"ERROR"},"message":{"type":"string"}}},"meta":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","example":false},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}}]},"id":"schema_16"},"schema_17":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count)."},"children":[],"type":"text"}],"type":"paragraph"}]},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]}}},"id":"schema_17"},"schema_18":{"kind":"json-schema","data":{"type":"object","required":["clientTypes","total"],"properties":{"clientTypes":{"type":"array","items":{"type":"object","description":"Every listed property is always present; optional columns are null when unset","required":["id","name","active","is_business","pms_ref","created_at","updated_at","created_by_staff_id","last_updated_by_staff_id"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"active":{"type":"boolean"},"is_business":{"type":["boolean","null"]},"pms_ref":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"created_by_staff_id":{"type":["integer","null"],"description":"ID of the staff member who created the client type"},"last_updated_by_staff_id":{"type":["integer","null"],"description":"ID of the staff member who last updated the client type"}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_18"},"schema_19":{"kind":"json-schema","data":{"type":"object","required":["taxRegions","total"],"properties":{"taxRegions":{"type":"array","items":{"type":"object","required":["id","name","active","description","tax_percentage","type","created_at","updated_at","created_by_staff_id","last_updated_by_staff_id","pms_ref"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"active":{"type":"boolean"},"description":{"type":["string","null"]},"tax_percentage":{"type":"number"},"type":{"type":["string","null"]},"created_at":{"type":["string","null"]},"updated_at":{"type":["string","null"]},"created_by_staff_id":{"type":["integer","null"],"description":"ID of the staff member who created the tax region"},"last_updated_by_staff_id":{"type":["integer","null"],"description":"ID of the staff member who last updated the tax region"},"pms_ref":{"type":"string","description":"Identifier of the tax region in the practice management system"}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_19"},"schema_20":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count)."},"children":[],"type":"text"}],"type":"paragraph"}],"example":25},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0}}},"id":"schema_20"},"schema_21":{"kind":"json-schema","data":{"type":"object","required":["clientGroups","total"],"properties":{"clientGroups":{"type":"array","items":{"$ref":"#/components/schemas/ClientGroup"}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of client groups in the tenant","example":142}}}}}}},"id":"schema_21"},"schema_22":{"kind":"json-schema","data":{"type":"object","required":["clientBusinessEntities","total"],"properties":{"clientBusinessEntities":{"type":"array","items":{"type":"object","description":"Every listed property is always present; optional columns are null when unset","required":["id","name","active","clientBusinessEntityType","ref","sysRefs","createdAt","updatedAt","version","pmsRefs","customFieldValues"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"active":{"type":"boolean"},"clientBusinessEntityType":{"type":"string"},"ref":{"type":"string"},"sysRefs":{"description":"Source-system references (JSON); null when unset"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"version":{"type":"integer"},"pmsRefs":{"type":"string","description":"Identifier of the business entity in the practice management system"},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields for the business entity, keyed by custom field code"}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_22"},"schema_23":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Defaults to 50 when omitted."},"children":[],"type":"text"}],"type":"paragraph"}]},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex contact filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"contact_info":{"firstName":{"_ilike":"%john%"}}},{"contact_info":{"lastName":{"_ilike":"%doe%"}}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"contact_info":{"email":{"_ilike":"%@company.com%"}}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":"Dynamic ordering with nested relationship fields","example":[{"contact_info":{"lastName":"asc"}},{"createdAt":"desc"}]}}},"id":"schema_23"},"schema_24":{"kind":"json-schema","data":{"type":"object","required":["contact"],"properties":{"contact":{"anyOf":[{"$ref":"#/components/schemas/Contact"},{"type":"null"}]}}},"id":"schema_24"},"schema_25":{"kind":"json-schema","data":{"type":"object","required":["contacts"],"properties":{"contacts":{"type":"array","items":{"type":"object","required":["contact_id","client_id","active","relationship","receives_invoice","receives_statement","receives_payment_confirmation","contact"],"properties":{"contact_id":{"type":"integer","description":"Unique contact identifier","example":23456},"client_id":{"type":"integer","description":"Associated client identifier","example":789},"active":{"type":"boolean","description":"Whether this contact-client relationship is active","example":true},"relationship":{"type":["string","null"],"description":"Relationship type between the contact and client; null when unset","example":"PRIMARY"},"receives_invoice":{"type":["boolean","null"],"description":"Whether this contact receives invoices; null when never set","example":true},"receives_statement":{"type":["boolean","null"],"description":"Whether this contact receives statements; null when never set","example":false},"receives_payment_confirmation":{"type":["boolean","null"],"description":"Whether this contact receives payment confirmations; null when never set","example":true},"contact":{"type":"object","required":["id","pms_ref","active","type","fwd_email_confirmation","inactivated_at","created_at","updated_at","is_managed_by_aiwyn","is_created_by_aiwyn","username","custom_field_values","contact_info"],"properties":{"id":{"type":"integer","example":23456},"pms_ref":{"type":"string","description":"PMS reference identifier","example":"PMS-001"},"active":{"type":"boolean","example":true},"type":{"type":["string","null"],"description":"Contact type; null when unset","example":"CLIENT_CONTACT"},"fwd_email_confirmation":{"type":"boolean","description":"Whether to forward email confirmations to this contact","example":true},"inactivated_at":{"type":["string","null"],"format":"date-time","description":"When the contact was inactivated (no time zone offset); null while active","example":null},"created_at":{"type":"string","format":"date-time","description":"When the record was created","example":"2024-03-01T15:20:11.104223+00:00"},"updated_at":{"type":"string","format":"date-time","description":"When the record was last updated","example":"2024-09-14T08:02:47.551092+00:00"},"is_managed_by_aiwyn":{"type":"boolean","description":"Whether Aiwyn manages the record's lifecycle","example":false},"is_created_by_aiwyn":{"type":"boolean","description":"Whether the record was created in Aiwyn","example":false},"username":{"type":["string","null"],"description":"Client portal username of the contact; null when the contact has no portal account","example":"jane.smith@acme.com"},"custom_field_values":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields for the contact, keyed by custom field code","example":null},"contact_info":{"type":"object","required":["id","salutation","firstName","lastName","email","phone","address","address2","city","state","country","zip_code","active"],"properties":{"id":{"type":"integer","example":5678},"salutation":{"type":["string","null"],"example":"Mr."},"firstName":{"type":["string","null"],"example":"John"},"lastName":{"type":["string","null"],"example":"Smith"},"email":{"type":["string","null"],"example":"john.smith@acme.com"},"phone":{"type":["string","null"],"example":"+1-555-0123"},"address":{"type":["string","null"],"example":"123 Business Ave"},"address2":{"type":["string","null"],"example":"Suite 400"},"city":{"type":["string","null"],"example":"New York"},"state":{"type":["string","null"],"example":"NY"},"country":{"type":["string","null"],"example":"USA"},"zip_code":{"type":["string","null"],"example":"10001"},"active":{"type":"boolean","example":true}}}}}}}}}},"id":"schema_25"},"schema_26":{"kind":"json-schema","data":{"type":"object","required":["contacts"],"properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"pmsRef":{"type":["string","null"],"description":"Pmsref"},"contactInfo":{"type":"object","description":"Contactinfo"},"username":{"type":["string","null"],"description":"Username"},"type":{"type":["string","null"],"description":"Type"},"fwdEmailConfirmation":{"type":["boolean","null"],"description":"Fwdemailconfirmation"},"fwdEmailConfirmationAddresses":{"type":["string","null"],"description":"Fwdemailconfirmationaddresses"},"active":{"type":["boolean","null"],"description":"Active"},"clients":{"type":"array","items":{"type":"object","properties":{"clientRef":{"type":"string","description":"Clientref"},"relationship":{"type":["string","null"],"description":"Relationship"},"receivesInvoice":{"type":["boolean","null"],"description":"Receivesinvoice"},"receivesStatement":{"type":["boolean","null"],"description":"Receivesstatement"},"receivesPaymentConfirmation":{"type":["boolean","null"],"description":"Receivespaymentconfirmation"},"active":{"type":["boolean","null"],"description":"Active"}}},"description":"Clients"}}},"description":"Contacts"}}},"id":"schema_26"},"schema_27":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["total","succeeded","failed"],"properties":{"total":{"type":"integer","format":"int32","description":"Total"},"succeeded":{"type":"array","items":{"type":"object","required":["index","contact","contactInfo","clients"],"properties":{"index":{"type":"integer","format":"int32","description":"Index"},"contact":{"type":"object","description":"Contact"},"contactInfo":{"type":"object","description":"Contactinfo"},"clients":{"type":"array","items":{"type":"object"},"description":"Clients"}}},"description":"Succeeded"},"failed":{"type":"array","items":{"type":"object","required":["index","error"],"properties":{"index":{"type":"integer","format":"int32","description":"Index"},"pmsRef":{"type":["string","null"],"description":"Pmsref"},"error":{"type":"string","description":"Error"}}},"description":"Failed"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_27"},"schema_28":{"kind":"json-schema","data":{"type":"object","required":["contactClients","total"],"properties":{"contactClients":{"type":"array","items":{"type":"object","description":"Every listed property is always present; optional columns are null when unset","required":["id","pms_ref","active","client_id","contact_id","relationship","receives_invoice","receives_statement","receives_payment_confirmation","sys_refs","created_at","updated_at","version","inactivated_at","is_managed_by_aiwyn","is_created_by_aiwyn","custom_field_values"],"properties":{"id":{"type":"integer"},"pms_ref":{"type":"string"},"active":{"type":"boolean"},"client_id":{"type":"integer"},"contact_id":{"type":"integer"},"relationship":{"type":["string","null"]},"receives_invoice":{"type":["boolean","null"]},"receives_statement":{"type":["boolean","null"]},"receives_payment_confirmation":{"type":["boolean","null"]},"sys_refs":{"description":"Source-system references (JSON); null when unset"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"version":{"type":"integer"},"inactivated_at":{"type":["string","null"],"format":"date-time","description":"When the link between the contact and the client was inactivated (no time zone offset)"},"is_managed_by_aiwyn":{"type":"boolean","description":"Whether Aiwyn manages the record's lifecycle"},"is_created_by_aiwyn":{"type":"boolean","description":"Whether the record was created in Aiwyn"},"custom_field_values":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields for the contact-client link, keyed by custom field code"}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_28"},"schema_29":{"kind":"json-schema","data":{"type":"object","required":["contactInfos","total"],"properties":{"contactInfos":{"type":"array","items":{"type":"object","description":"Every listed property is always present; optional columns are null when unset","required":["id","pms_ref","active","salutation","firstName","lastName","email","phone","address","address2","city","state","country","zip_code","created_at","updated_at","version","full_name","short_name","is_managed_by_aiwyn","is_created_by_aiwyn","job_title","prefix","custom_field_values"],"properties":{"id":{"type":"integer"},"pms_ref":{"type":"string"},"active":{"type":"boolean"},"salutation":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"address2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"country":{"type":["string","null"]},"zip_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"version":{"type":"integer"},"full_name":{"type":"string","description":"Full name"},"short_name":{"type":["string","null"],"description":"Short or informal name"},"is_managed_by_aiwyn":{"type":"boolean","description":"Whether Aiwyn manages the record's lifecycle"},"is_created_by_aiwyn":{"type":"boolean","description":"Whether the record was created in Aiwyn"},"job_title":{"type":["string","null"],"description":"Job title"},"prefix":{"type":["string","null"],"description":"Name prefix"},"custom_field_values":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields for the contact info, keyed by custom field code"}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_29"},"schema_30":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":25},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0}}},"id":"schema_30"},"schema_31":{"kind":"json-schema","data":{"type":"object","required":["error"],"properties":{"path":{"type":"string","description":"JSON path of the failing input","example":"$"},"error":{"type":"string","description":"Human-readable error message","example":"Unexpected variable clientId"},"code":{"type":"string","description":"Hasura error code","example":"bad-request"}}},"id":"schema_31"},"schema_32":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":1},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"name":{"_ilike":"%review%"}},{"engagementNameTemplate":{"_ilike":"%tax%"}}]},{"status":{"_in":["SENT","EXECUTED"]}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"partnerStaffId":{"_in":[5,6,7,8]}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":"Dynamic ordering specifications","example":[{"name":"asc"},{"createdAt":"desc"}]}}},"id":"schema_32"},"schema_33":{"kind":"json-schema","data":{"type":"object","required":["engagement"],"properties":{"engagement":{"type":"array","maxItems":1,"description":"The engagement, or an empty array when the id matches no active engagement","items":{"$ref":"#/components/schemas/Engagement"}}}},"id":"schema_33"},"schema_34":{"kind":"json-schema","data":{"type":"object","required":["error","code"],"properties":{"path":{"type":"string","description":"JSON path of the failing input","example":"$"},"error":{"type":"string","description":"Human-readable error message","example":"invalid input syntax for type integer: \"abc\""},"code":{"type":"string","description":"Hasura error code","example":"data-exception"}}},"id":"schema_34"},"schema_35":{"kind":"json-schema","data":{"type":"integer","format":"int64","minimum":1},"id":"schema_35"},"schema_36":{"kind":"json-schema","data":{"type":"object","properties":{"clientId":{"type":["integer","null"],"format":"int64","description":"ID of the primary client for this engagement","example":789},"fiscalYear":{"type":["integer","null"],"format":"int32","description":"Fiscal year of the engagement","example":2025},"partnerStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the partner staff member assigned to the engagement","example":456},"managerStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the manager staff member assigned to the engagement","example":457},"primaryContactId":{"type":["integer","null"],"format":"int64","description":"ID of the primary contact for this engagement","example":101},"secondaryContactId":{"type":["integer","null"],"format":"int64","description":"ID of the secondary contact for this engagement","example":102},"startDate":{"type":["string","null"],"format":"date","description":"Engagement start date (YYYY-MM-DD)","example":"2025-01-01"},"endDate":{"type":["string","null"],"format":"date","description":"Engagement end date (YYYY-MM-DD)","example":"2025-12-31"},"billingContactId":{"type":["integer","null"],"format":"int64","description":"ID of the billing contact for this engagement","example":103},"ccStaffIds":{"type":["array","null"],"items":{"type":"integer","format":"int64"},"description":"IDs of staff members to CC on engagement communications","example":[458,459]},"engagementLetterTemplateId":{"type":["integer","null"],"format":"int64","description":"ID of the engagement letter template to use","example":55},"documentTemplateId":{"type":["integer","null"],"format":"int64","description":"ID of the document template to use","example":66},"engagementNameTemplate":{"type":["string","null"],"description":"Template string used to generate the engagement name","example":"{clientName} {fiscalYear} Audit"},"additionalClientIds":{"type":["array","null"],"items":{"type":"integer","format":"int64"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"IDs of additional clients to associate with this engagement."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"When provided, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"replaces"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" all existing additional client associations."},"children":[],"type":"text"}],"type":"paragraph"}],"example":[790,791]},"jobIds":{"type":["array","null"],"items":{"type":"integer","format":"int64"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"IDs of jobs (projects) to link to this engagement."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"When provided, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"replaces"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" all existing job links."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"If "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"additionalClientIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is omitted when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"jobIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is provided, existing additional"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"clients are preserved."},"children":[],"type":"text"}],"type":"paragraph"}],"example":[101,102]}}},"id":"schema_36"},"schema_37":{"kind":"json-schema","data":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"ID of the updated engagement","example":12345}}},"id":"schema_37"},"schema_38":{"kind":"json-schema","data":{"type":"object","required":["message","extensions"],"properties":{"message":{"type":"string","description":"Human-readable error message","example":"Invalid additional client IDs: 999999, 999998"},"extensions":{"type":"object","required":["code","details"],"properties":{"code":{"type":"integer","description":"HTTP status code","example":400},"details":{"type":["object","null"],"description":"Additional error context. Null for these errors."}}}}},"id":"schema_38"},"schema_39":{"kind":"json-schema","data":{"type":"object","required":["message","extensions"],"properties":{"message":{"type":"string","description":"Human-readable error message","example":"Engagement not found: 12345"},"extensions":{"type":"object","required":["code","details"],"properties":{"code":{"type":"integer","description":"HTTP status code","example":404},"details":{"type":["object","null"],"description":"Additional error context. Null for these errors."}}}}},"id":"schema_39"},"schema_40":{"kind":"json-schema","data":{"type":"object","required":["clientId","fiscalYear","partnerStaffId","managerStaffId","primaryContactId"],"anyOf":[{"required":["engagementLetterTemplateId"]},{"required":["documentTemplateId"]}],"properties":{"clientId":{"type":"integer","format":"int64","description":"Unique identifier of the client for this engagement","example":420},"fiscalYear":{"type":"integer","description":"Fiscal year of the engagement","example":2024},"partnerStaffId":{"type":"integer","format":"int64","description":"Unique identifier of the partner staff member","example":53},"managerStaffId":{"type":"integer","format":"int64","description":"Unique identifier of the manager staff member","example":15},"primaryContactId":{"type":"integer","format":"int64","description":"Unique identifier of the primary client contact","example":101},"secondaryContactId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the secondary client contact","example":102},"billingContactId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the billing contact","example":103},"engagementLetterTemplateId":{"type":["integer","null"],"format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unique identifier of the engagement letter template to use. Required unless"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"documentTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is provided."},"children":[],"type":"text"}],"type":"paragraph"}],"example":5},"documentTemplateId":{"type":["integer","null"],"format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unique identifier of the document template to use. Required unless"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"engagementLetterTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is provided."},"children":[],"type":"text"}],"type":"paragraph"}],"example":7},"engagementNameTemplate":{"type":["string","null"],"description":"Template string used to generate the engagement name. Overrides the firm's default naming template.\n","example":"{{fiscal_year.year}} {{letter_template.name}} {{client.number}}"},"startDate":{"type":["string","null"],"format":"date","description":"Engagement start date (YYYY-MM-DD)","example":"2024-01-01"},"endDate":{"type":["string","null"],"format":"date","description":"Engagement end date (YYYY-MM-DD)","example":"2024-12-31"},"ccStaffIds":{"type":["array","null"],"description":"List of staff member IDs to CC on the engagement","items":{"type":"integer","format":"int64"},"example":[20,21]},"additionalClientIds":{"type":["array","null"],"description":"IDs of additional clients to associate with the engagement","items":{"type":"integer","format":"int64"},"example":[790,791]},"jobIds":{"type":["array","null"],"description":"IDs of jobs (projects) to link to this engagement","items":{"type":"integer","format":"int64"},"example":[101,102]},"additionalDocuments":{"type":["array","null"],"description":"Extra documents to attach to the engagement","items":{"type":"object","required":["documentTemplateId","documentType"],"properties":{"documentTemplateId":{"type":"integer","format":"int64","description":"Unique identifier of the document template","example":12},"documentType":{"type":"string","enum":["CONSENT","ADD_ON"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Type of the document. Any other value is rejected with 400"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invalid document type '<value>'. Valid values: CONSENT, ADD_ON"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"CONSENT"}}}}}},"id":"schema_40"},"schema_41":{"kind":"json-schema","data":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the newly created engagement","example":34567}}},"id":"schema_41"},"schema_42":{"kind":"json-schema","data":{"type":"object","required":["batchEngagements"],"properties":{"name":{"type":["string","null"],"description":"Optional label for the batch","example":"2024 Annual Batch"},"projectTemplateId":{"type":["integer","null"],"format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Project template ID to apply to every engagement in the batch. Cannot be combined with per-engagement "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":10},"includeAdditionalClients":{"type":"boolean","default":false,"description":"Whether to include additional clients when creating engagements","example":false},"batchEngagements":{"type":"array","description":"List of engagement records to create","items":{"type":"object","required":["clientId","fiscalYear","primaryContactId"],"properties":{"clientId":{"type":"integer","format":"int64","description":"Unique identifier of the client","example":420},"fiscalYear":{"type":"integer","description":"Fiscal year of the engagement","example":2024},"primaryContactId":{"type":"integer","format":"int64","description":"Unique identifier of the primary client contact","example":101},"partnerStaffId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the partner staff member","example":53},"managerStaffId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the manager staff member","example":15},"secondaryContactId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the secondary client contact","example":102},"billingContactId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the billing contact","example":103},"engagementLetterTemplateId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the engagement letter template to use","example":5},"documentTemplateId":{"type":["integer","null"],"format":"int64","description":"Unique identifier of the document template to use","example":7},"engagementNameTemplate":{"type":["string","null"],"description":"Template string used to generate the engagement name. Overrides the firm's default naming template.\n","example":"{{fiscal_year.year}} {{letter_template.name}} {{client.number}}"},"startDate":{"type":["string","null"],"format":"date","description":"Engagement start date (YYYY-MM-DD)","example":"2024-01-01"},"endDate":{"type":["string","null"],"format":"date","description":"Engagement end date (YYYY-MM-DD)","example":"2024-12-31"},"ccStaffIds":{"type":["array","null"],"description":"List of staff member IDs to CC on the engagement","items":{"type":"integer","format":"int64"},"example":[20,21]},"projectIds":{"type":["array","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"List of project IDs to associate with this engagement. Cannot be used when a top-level "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"projectTemplateId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is provided."},"children":[],"type":"text"}],"type":"paragraph"}],"items":{"type":"integer","format":"int64"},"example":[301,302]}}}}}},"id":"schema_42"},"schema_43":{"kind":"json-schema","data":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the created engagement batch","example":9001}}},"id":"schema_43"},"schema_44":{"kind":"json-schema","data":{"type":"object","properties":{"batchId":{"type":"integer","format":"int64","description":"Unique identifier of the engagement batch","example":9001},"status":{"type":"string","description":"Current processing status of the batch","enum":["DRAFT","CREATING","CREATED","CANCELED"],"example":"CREATED"},"engagementIds":{"type":"array","description":"IDs of engagements created by this batch","items":{"type":"integer","format":"int64"},"example":[34567,34568]}}},"id":"schema_44"},"schema_45":{"kind":"json-schema","data":{"type":"object","required":["engagementDocuments"],"properties":{"engagementDocuments":{"type":"array","items":{"type":"object","required":["id","fileId","engagementId","engagementDocumentTypeId","is_active","clientFacing","blocksExecution","signatureRequirementType","createdAt","updatedAt","affirmativeStatus","documentType"],"properties":{"id":{"type":"integer","description":"Unique engagement document identifier","example":101},"fileId":{"type":["integer","null"],"description":"Associated file identifier. Null when no file is attached.","example":5001},"engagementId":{"type":"integer","description":"Associated engagement identifier","example":34567},"engagementDocumentTypeId":{"type":"integer","description":"Document type identifier: 1 Engagement Letter, 2 Supplemental Document, 3 Combined Document,\n4 Consent Document, 5 Agreement Document, 6 Add-On Document\n","example":4},"is_active":{"type":"boolean","description":"Whether this document record is active","example":true},"clientFacing":{"type":"boolean","description":"Whether the document is visible to the client","example":true},"blocksExecution":{"type":"boolean","description":"Whether this document must be signed before the engagement executes","example":true},"signatureRequirementType":{"type":["string","null"],"description":"Signature requirement mode","enum":["ALL_SIGNATURES_REQUIRED","ONE_SIGNATURE_REQUIRED",null],"example":"ALL_SIGNATURES_REQUIRED"},"createdAt":{"type":"string","format":"date-time","description":"Record creation timestamp","example":"2024-01-15T10:00:00Z"},"updatedAt":{"type":"string","format":"date-time","description":"Record last updated timestamp","example":"2024-03-20T14:30:00Z"},"affirmativeStatus":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Consent acceptance status of a consent or add-on document."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"NEGATIVE = one or more negative responses."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"AFFIRMATIVE = all signers responded positively."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INDETERMINATE = at least one positive response but not all signers have responded yet."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"EMPTY = signers are assigned but none has responded yet."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Null for other document types (for example the engagement letter) and for a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"consent or add-on document with no signers assigned."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"These rules don't change with signatureRequirementType: for a ONE_SIGNATURE_REQUIRED"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"document, any decline makes it NEGATIVE and an agreement while other signers haven't"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"answered makes it INDETERMINATE. Use the Engagement CONSENT_RECORDED webhook for the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"outcome of a one-signature consent."},"children":[],"type":"text"}],"type":"paragraph"}],"enum":["NEGATIVE","AFFIRMATIVE","INDETERMINATE","EMPTY",null],"example":"AFFIRMATIVE"},"createdByStaffId":{"type":["integer","null"],"description":"Staff member who created the document (staff id).","example":102},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff member who last updated the document (staff id).","example":102},"manuallyUploadedAt":{"type":["string","null"],"format":"date-time","description":"When the document was uploaded by hand rather than generated from a template.\nNull for generated documents.\n","example":null},"pages":{"type":["integer","null"],"description":"Number of pages in the document.","example":4},"totalExpectedInitials":{"type":["integer","null"],"description":"How many initials the document expects in total, across all signatories.","example":2},"totalExpectedSignatures":{"type":["integer","null"],"description":"How many signatures the document expects in total.","example":1},"hasAppendedCertificateOfCompletion":{"type":["boolean","null"],"description":"Whether a certificate of completion has been appended to the document.","example":false},"documentType":{"type":"object","description":"The document type associated with this record","properties":{"id":{"type":"integer","description":"Document type identifier","example":4},"name":{"type":"string","description":"Document type name","example":"Consent Document"}}}}}}}},"id":"schema_45"},"schema_46":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex project filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"name":{"_ilike":"%migration%"}},{"serviceDescription":{"_ilike":"%review%"}}]},{"isActive":{"_eq":true}},{"updatedAt":{"_gte":"1900-01-01T00:00:00Z"}},{"partnerStaffId":{"_in":[101,102,103]}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":"Dynamic ordering specifications","example":[{"updatedAt":"desc"},{"name":"asc"}]}}},"id":"schema_46"},"schema_47":{"kind":"json-schema","data":{"type":"object","required":["error"],"properties":{"path":{"type":"string","description":"JSON path of the failing input","example":"$.selectionSet.aiwynreleasecut_vw_job.args.where._and[1].active"},"error":{"type":"string","description":"Human-readable error message","example":"field 'active' not found in type: 'aiwynreleasecut_vw_job_bool_exp'"},"code":{"type":"string","description":"Hasura error code","example":"validation-failed"}}},"id":"schema_47"},"schema_48":{"kind":"json-schema","data":{"type":"object","required":["project"],"properties":{"project":{"type":"array","maxItems":1,"description":"The project, or an empty array when the id matches no project","items":{"$ref":"#/components/schemas/Project"}}}},"id":"schema_48"},"schema_49":{"kind":"json-schema","data":{"type":"object","required":["clientId","jobTemplates"],"properties":{"clientId":{"type":"integer","format":"int64","description":"Unique identifier of the client for whom jobs are being created","example":420},"jobTemplates":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"List of job templates to instantiate (1–100 entries)"},"children":[],"type":"text"}],"type":"paragraph"}],"minItems":1,"maxItems":100,"items":{"type":"object","required":["jobTemplateId"],"properties":{"jobTemplateId":{"type":"integer","format":"int64","description":"Unique identifier of the job template to use","example":7},"startDate":{"type":["string","null"],"format":"date","description":"Job start date (YYYY-MM-DD); overrides the template default","example":"2025-01-01"},"name":{"type":["string","null"],"description":"Job name; overrides the template default","example":"Tax Return 2024"},"serviceDescription":{"type":["string","null"],"description":"Service description; overrides the template default","example":"Annual federal and state tax preparation"},"estimationHours":{"type":["number","null"],"description":"Estimated hours for the job; overrides the template default","example":8.5},"feeAmount":{"type":["number","null"],"description":"Fee amount for the job; overrides the template default","example":1500},"requiredPrepayment":{"type":["number","null"],"description":"Required prepayment amount; overrides the template default","example":500},"includeWipType":{"type":["string","null"],"description":"WIP billing behavior; overrides the template default","enum":["INCLUDE_WIP","INCLUDE_WIP_IF_FINAL","DO_NOT_INCLUDE",null],"example":"INCLUDE_WIP_IF_FINAL"}}}}}},"id":"schema_49"},"schema_50":{"kind":"json-schema","data":{"type":"array","items":{"type":"integer","format":"int64"},"description":"List of IDs for the newly created jobs"},"id":"schema_50"},"schema_51":{"kind":"json-schema","data":{"type":"object","required":["jobId"],"properties":{"jobId":{"type":"integer","format":"int64","description":"Jobid"},"staffJobAssignments":{"type":"array","items":{"type":"object","properties":{"staffId":{"type":"integer","format":"int64","description":"Staffid"}}},"description":"Staffjobassignments"},"staffTaskAssignments":{"type":"array","items":{"type":"object","properties":{"staffId":{"type":"integer","format":"int64","description":"Staffid"},"taskTypeId":{"type":"integer","format":"int64","description":"Tasktypeid"}}},"description":"Stafftaskassignments"}}},"id":"schema_51"},"schema_52":{"kind":"json-schema","data":{"type":"object","required":["staffJobIds","staffTaskIds"],"properties":{"staffJobIds":{"type":"array","items":{"type":"integer","format":"int64"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"IDs of the staff_job records created, re-activated or deactivated"},"children":[],"type":"text"}],"type":"paragraph"}]},"staffTaskIds":{"type":"array","items":{"type":"integer","format":"int64"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"IDs of the task_type_staff_job records created, re-activated or deactivated"},"children":[],"type":"text"}],"type":"paragraph"}]}}},"id":"schema_52"},"schema_53":{"kind":"json-schema","data":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/JobRecord"}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer"}}}}}}},"id":"schema_53"},"schema_54":{"kind":"json-schema","data":{"type":"object","required":["job"],"properties":{"job":{"type":"array","maxItems":1,"description":"The job, or an empty array when the id matches no job","items":{"$ref":"#/components/schemas/JobRecord"}}}},"id":"schema_54"},"schema_55":{"kind":"json-schema","data":{"type":"object","properties":{"jobTemplates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"Unique job template identifier.","example":300},"pmsRef":{"type":"string","description":"Identifier in the external practice management system.","example":"JT-300"},"ref":{"type":"string","description":"Reference identifier for the template.","example":"1040"},"name":{"type":"string","description":"Name of the template.","example":"Individual Tax Return"},"active":{"type":["boolean","null"],"description":"Whether the template is active.","example":true},"serviceLineId":{"type":["integer","null"],"description":"Service line of the template (service line id).","example":10},"isCreatedByAiwyn":{"type":["boolean","null"],"description":"Whether the record was created in Aiwyn.","example":true},"isManagedByAiwyn":{"type":["boolean","null"],"description":"Whether Aiwyn manages the record's lifecycle.","example":true},"sysRefs":{"type":["object","null"],"description":"References of the template in connected systems, keyed by system.","example":{}},"createdAt":{"type":["string","null"],"format":"date-time","description":"When the record was created.","example":"2025-01-02T03:04:05Z"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"When the record was last updated.","example":"2025-01-02T03:04:05Z"},"version":{"type":["integer","null"],"description":"Record version for optimistic concurrency.","example":1},"jobNameTemplate":{"type":"string","description":"Pattern used to generate the name of projects created from the template.","example":"{{client.name}} 1040 {{year}}"},"jobDescriptionTemplate":{"type":["string","null"],"description":"Pattern used to generate the description of projects created from the template.","example":null},"longServiceDescriptionTemplate":{"type":["string","null"],"description":"Extended service description applied to projects created from the template.","example":null},"modifiedByStaffId":{"type":["integer","null"],"description":"Staff member who last modified the template (staff id).","example":null},"createdByStaffId":{"type":["integer","null"],"description":"Staff member who created the template (staff id).","example":102},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff member who last updated the template (staff id).","example":102},"startOffset":{"type":["integer","null"],"description":"Offset applied to the start date of projects created from the template.","example":0},"startOffsetType":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unit of the start offset, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DAYS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"WEEKS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"MONTHS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"DAYS"},"startAfterType":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Reference point the start offset is calculated from, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PROJECT_CREATION"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ENGAGEMENT_SIGNED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"PROJECT_CREATION"},"dueOffset":{"type":["integer","null"],"description":"Offset applied to the due date of projects created from the template.","example":30},"dueOffsetType":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unit of the due offset, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DAYS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"WEEKS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"MONTHS"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"DAYS"},"estimationEnabled":{"type":["boolean","null"],"description":"Whether hour estimation is enabled for projects created from the template.","example":false},"estimationHours":{"type":["number","null"],"description":"Estimated hours for projects created from the template.","example":null},"primaryDeliverableTemplateId":{"type":["integer","null"],"description":"Primary deliverable template of the template (deliverable template id).","example":null},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields of the template, keyed by custom field code.","example":{}}}}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer"}}}}}}},"id":"schema_55"},"schema_56":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"clientId":{"_in":[1001,1002]}},{"jobId":{"_in":[2001,2002]}}]},{"client":{"active":{"_eq":true}}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"activityType":{"_in":["DRAFT_INVOICE_CREATED","DRAFT_INVOICE_RECONCILED"]}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":"Dynamic ordering specifications","example":[{"clientId":"asc"},{"createdAt":"desc"}]}}},"id":"schema_56"},"schema_57":{"kind":"json-schema","data":{"type":"object","required":["draft_invoice_history"],"properties":{"draft_invoice_history":{"type":"array","description":"At most one draft invoice history record (empty if the invoice id has none)","maxItems":1,"items":{"$ref":"#/components/schemas/DraftInvoiceHistory"}}}},"id":"schema_57"},"schema_58":{"kind":"json-schema","data":{"type":"object","required":["code","error"],"properties":{"path":{"type":"string","example":"$"},"error":{"type":"string","example":"invalid input syntax for type bigint: \"abc\""},"code":{"type":"string","example":"data-exception"}}},"id":"schema_58"},"schema_59":{"kind":"json-schema","data":{"type":"object","required":["invoices","total"],"properties":{"invoices":{"type":"array","items":{"type":"object","required":["arTranId","invoiceNumber","dueDate","status","tax","interest","description","createdAt","updatedAt","ar_tran","postedAt","deliveryMethod","emailRecipients","invoiceFileId","reversalReason","reversedAt","reversedByStaffId"],"properties":{"arTranId":{"type":"integer","description":"Invoice identifier (equal to the AR transaction id)","example":125890},"invoiceNumber":{"type":"string","description":"Unique invoice number for client reference","example":"INV-2024-4850"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Invoice payment due date, as a local date-time with no time-zone offset","example":"2024-04-24T05:00:00"},"status":{"type":"string","description":"Current invoice status","example":"POSTED"},"tax":{"type":"number","format":"decimal","description":"Tax amount charged on invoice","example":0},"interest":{"type":"number","format":"decimal","description":"Interest charges applied to invoice","example":0},"description":{"type":["string","null"],"description":"Additional invoice description or notes","example":null},"createdAt":{"type":"string","format":"date-time","description":"Invoice record creation timestamp","example":"2024-05-12T22:50:20.595961+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"Invoice record last update timestamp","example":"2024-05-12T22:50:20.595961+00:00"},"postedAt":{"type":["string","null"],"format":"date-time","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When the invoice was posted. Distinct from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ar_tran.transactionDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the date the invoice carries."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"2024-05-12T22:50:20.595961+00:00"},"deliveryMethod":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How the invoice was delivered: EMAIL, DOWNLOAD, EMAIL_AND_DOWNLOAD or POST_ONLY"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"EMAIL"},"emailRecipients":{"type":["string","null"],"description":"Email recipients the invoice was sent to","example":"ap@techflow.example"},"invoiceFileId":{"type":["integer","null"],"description":"Identifier of the invoice PDF file","example":88231},"reversalReason":{"type":["string","null"],"description":"Reason recorded when the posted invoice was reversed","example":null},"reversedAt":{"type":["string","null"],"format":"date-time","description":"When the invoice was reversed","example":null},"reversedByStaffId":{"type":["integer","null"],"description":"Identifier of the staff member who reversed the invoice","example":null},"ar_tran":{"type":"object","description":"Associated AR transaction details","required":["id","pmsRef","transactionDate","amount","allocated","clientId","allocatedInCurrency","amountInCurrency","businessEntityId","createdAt","currencyId","customFieldValues","exchangeRate","internalNotes","isActive","isCreatedByAiwyn","isManagedByAiwyn","isPosted","isReconciled","managerStaffId","notes","partnerStaffId","pmsCreatedAt","projectId","responsibleStaffId","type","updatedAt"],"properties":{"id":{"type":"integer","example":125890},"pmsRef":{"type":"string","description":"Practice management system reference","example":"240815"},"transactionDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Transaction date, as a local date-time with no time-zone offset","example":"2024-03-22T05:00:00"},"amount":{"type":"number","format":"decimal","description":"Transaction amount","example":4250},"allocated":{"type":"number","format":"decimal","description":"Allocated amount","example":4250},"clientId":{"type":["integer","null"],"description":"Client identifier","example":7720},"allocatedInCurrency":{"type":["number","null"],"description":"Applied amount in the transaction currency","example":null},"amountInCurrency":{"type":["number","null"],"description":"Transaction amount in the transaction currency","example":null},"businessEntityId":{"type":["integer","null"],"description":"Identifier of the firm business entity","example":1},"createdAt":{"type":"string","format":"date-time","description":"When the AR transaction was created","example":"2024-05-12T22:50:20.595961+00:00"},"currencyId":{"type":["integer","null"],"description":"Identifier of the currency of the amounts ending in InCurrency. Null when no currency is recorded.","example":null},"customFieldValues":{"type":["object","null"],"description":"Firm-defined custom fields, keyed by field name","example":null},"exchangeRate":{"type":["number","null"],"description":"Exchange rate to the firm currency","example":null},"internalNotes":{"type":["string","null"],"description":"Internal notes on the transaction, visible only to firm staff","example":null},"isActive":{"type":["boolean","null"],"description":"Whether the transaction is active; inactive transactions were deleted or reversed","example":true},"isCreatedByAiwyn":{"type":"boolean","description":"Whether the transaction was created in Aiwyn","example":true},"isManagedByAiwyn":{"type":"boolean","description":"Whether Aiwyn manages the transaction's lifecycle","example":false},"isPosted":{"type":"boolean","description":"Whether the transaction is posted","example":true},"isReconciled":{"type":["boolean","null"],"description":"Whether the transaction is reconciled","example":null},"managerStaffId":{"type":["integer","null"],"description":"Identifier of the manager staff member","example":301},"notes":{"type":["string","null"],"description":"Notes on the transaction visible to the client","example":null},"partnerStaffId":{"type":["integer","null"],"description":"Identifier of the partner staff member","example":302},"pmsCreatedAt":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"When the transaction was created in your practice management system, as a local date-time with no time-zone offset. Null when the system does not provide it; for transactions created in Aiwyn, when Aiwyn created them.","example":"2024-03-22T05:00:00"},"projectId":{"type":["integer","null"],"description":"Identifier of the project the transaction belongs to","example":2514},"responsibleStaffId":{"type":["integer","null"],"description":"Identifier of the responsible staff member","example":303},"type":{"type":"string","description":"AR transaction type, for example Invoice, Receipt, Credit, Debit, LateFee, ProcessingFee, Refund, Dispute, DraftInvoice, Prepayment, ReceiptAdj, BadDebt, InternationalFee, LateFeeReversal or Unknown","example":"Invoice"},"updatedAt":{"type":"string","format":"date-time","description":"When the AR transaction was last updated","example":"2024-05-12T22:50:20.595961+00:00"}}}}}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of invoices","example":94}}}}}}},"id":"schema_59"},"schema_60":{"kind":"json-schema","data":{"type":"object","required":["error"],"properties":{"path":{"type":"string"},"error":{"type":"string"},"code":{"type":"string"}}},"id":"schema_60"},"schema_61":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex invoice filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"invoiceNumber":{"_ilike":"%2024%"}},{"description":{"_ilike":"%service%"}}]},{"status":{"_in":["POSTED","CLOSED"]}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"dueDate":{"_gte":"2024-01-01T00:00:00"}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":"Dynamic ordering specifications","example":[{"invoiceNumber":"asc"},{"createdAt":"desc"}]}}},"id":"schema_61"},"schema_62":{"kind":"json-schema","data":{"type":"object","required":["invoices","total"],"properties":{"invoices":{"type":"array","items":{"type":"object","required":["arTranId","invoiceNumber","dueDate","status","tax","interest","description","createdAt","updatedAt","ar_tran","postedAt","deliveryMethod","emailRecipients","invoiceFileId","reversalReason","reversedAt","reversedByStaffId"],"properties":{"arTranId":{"type":"integer","description":"Invoice identifier (equal to the AR transaction id)","example":125890},"invoiceNumber":{"type":"string","example":"INV-2024-4850"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Invoice payment due date, as a local date-time with no time-zone offset","example":"2024-04-24T05:00:00"},"status":{"type":"string","example":"POSTED"},"tax":{"type":"number","description":"Tax amount recorded on the invoice","example":0},"interest":{"type":"number","description":"Interest amount recorded on the invoice","example":0},"description":{"type":["string","null"],"example":null},"createdAt":{"type":"string","format":"date-time","example":"2024-05-12T22:50:20.595961+00:00"},"updatedAt":{"type":"string","format":"date-time","example":"2024-05-12T22:50:20.595961+00:00"},"postedAt":{"type":["string","null"],"format":"date-time","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When the invoice was posted. Distinct from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ar_tran.transactionDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the date the invoice carries."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"2024-05-12T22:50:20.595961+00:00"},"deliveryMethod":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How the invoice was delivered: EMAIL, DOWNLOAD, EMAIL_AND_DOWNLOAD or POST_ONLY"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"EMAIL"},"emailRecipients":{"type":["string","null"],"description":"Email recipients the invoice was sent to","example":"ap@techflow.example"},"invoiceFileId":{"type":["integer","null"],"description":"Identifier of the invoice PDF file","example":88231},"reversalReason":{"type":["string","null"],"description":"Reason recorded when the posted invoice was reversed","example":null},"reversedAt":{"type":["string","null"],"format":"date-time","description":"When the invoice was reversed","example":null},"reversedByStaffId":{"type":["integer","null"],"description":"Identifier of the staff member who reversed the invoice","example":null},"ar_tran":{"type":"object","description":"Associated AR transaction details","required":["id","pmsRef","transactionDate","amount","allocated","clientId","allocatedInCurrency","amountInCurrency","businessEntityId","createdAt","currencyId","customFieldValues","exchangeRate","internalNotes","isActive","isCreatedByAiwyn","isManagedByAiwyn","isPosted","isReconciled","managerStaffId","notes","partnerStaffId","pmsCreatedAt","projectId","responsibleStaffId","type","updatedAt"],"properties":{"id":{"type":"integer","example":125890},"pmsRef":{"type":"string","description":"Practice-management-system reference","example":"240815"},"transactionDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Transaction date, as a local date-time with no time-zone offset","example":"2024-03-22T05:00:00"},"amount":{"type":"number","description":"Total transaction amount","example":4250},"allocated":{"type":"number","description":"Amount allocated (applied/paid) against the transaction","example":4250},"clientId":{"type":["integer","null"],"example":7720},"allocatedInCurrency":{"type":["number","null"],"description":"Applied amount in the transaction currency","example":null},"amountInCurrency":{"type":["number","null"],"description":"Transaction amount in the transaction currency","example":null},"businessEntityId":{"type":["integer","null"],"description":"Identifier of the firm business entity","example":1},"createdAt":{"type":"string","format":"date-time","description":"When the AR transaction was created","example":"2024-05-12T22:50:20.595961+00:00"},"currencyId":{"type":["integer","null"],"description":"Identifier of the currency of the amounts ending in InCurrency. Null when no currency is recorded.","example":null},"customFieldValues":{"type":["object","null"],"description":"Firm-defined custom fields, keyed by field name","example":null},"exchangeRate":{"type":["number","null"],"description":"Exchange rate to the firm currency","example":null},"internalNotes":{"type":["string","null"],"description":"Internal notes on the transaction, visible only to firm staff","example":null},"isActive":{"type":["boolean","null"],"description":"Whether the transaction is active; inactive transactions were deleted or reversed","example":true},"isCreatedByAiwyn":{"type":"boolean","description":"Whether the transaction was created in Aiwyn","example":true},"isManagedByAiwyn":{"type":"boolean","description":"Whether Aiwyn manages the transaction's lifecycle","example":false},"isPosted":{"type":"boolean","description":"Whether the transaction is posted","example":true},"isReconciled":{"type":["boolean","null"],"description":"Whether the transaction is reconciled","example":null},"managerStaffId":{"type":["integer","null"],"description":"Identifier of the manager staff member","example":301},"notes":{"type":["string","null"],"description":"Notes on the transaction visible to the client","example":null},"partnerStaffId":{"type":["integer","null"],"description":"Identifier of the partner staff member","example":302},"pmsCreatedAt":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"When the transaction was created in your practice management system, as a local date-time with no time-zone offset. Null when the system does not provide it; for transactions created in Aiwyn, when Aiwyn created them.","example":"2024-03-22T05:00:00"},"projectId":{"type":["integer","null"],"description":"Identifier of the project the transaction belongs to","example":2514},"responsibleStaffId":{"type":["integer","null"],"description":"Identifier of the responsible staff member","example":303},"type":{"type":"string","description":"AR transaction type, for example Invoice, Receipt, Credit, Debit, LateFee, ProcessingFee, Refund, Dispute, DraftInvoice, Prepayment, ReceiptAdj, BadDebt, InternationalFee, LateFeeReversal or Unknown","example":"Invoice"},"updatedAt":{"type":"string","format":"date-time","description":"When the AR transaction was last updated","example":"2024-05-12T22:50:20.595961+00:00"}}}}}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of invoices matching the where clause","example":12}}}}}}},"id":"schema_62"},"schema_63":{"kind":"json-schema","data":{"type":"object","required":["invoice"],"properties":{"invoice":{"type":["object","null"],"description":"The invoice, or null when the id matches no invoice","required":["arTranId","invoiceNumber","dueDate","status","tax","interest","description","createdAt","updatedAt","ar_tran","postedAt","deliveryMethod","emailRecipients","invoiceFileId","reversalReason","reversedAt","reversedByStaffId"],"properties":{"arTranId":{"type":"integer","description":"Invoice identifier (equal to the AR transaction id)","example":45678},"invoiceNumber":{"type":"string","description":"Invoice number","example":"INV-2024-001"},"dueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Invoice due date, as a local date-time with no time-zone offset","example":"2024-12-31T23:59:59"},"status":{"type":"string","description":"Invoice status","example":"POSTED"},"tax":{"type":"number","description":"Tax amount recorded on the invoice","example":2000},"interest":{"type":"number","description":"Interest amount recorded on the invoice","example":0},"description":{"type":["string","null"],"description":"Invoice description","example":"Q4 Financial Audit"},"createdAt":{"type":"string","format":"date-time","description":"Invoice creation timestamp","example":"2024-12-01T09:00:00Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp","example":"2024-12-15T10:30:00Z"},"postedAt":{"type":["string","null"],"format":"date-time","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When the invoice was posted. Distinct from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ar_tran.transactionDate"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", the date the invoice carries."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"2024-05-12T22:50:20.595961+00:00"},"deliveryMethod":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How the invoice was delivered: EMAIL, DOWNLOAD, EMAIL_AND_DOWNLOAD or POST_ONLY"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"EMAIL"},"emailRecipients":{"type":["string","null"],"description":"Email recipients the invoice was sent to","example":"ap@techflow.example"},"invoiceFileId":{"type":["integer","null"],"description":"Identifier of the invoice PDF file","example":88231},"reversalReason":{"type":["string","null"],"description":"Reason recorded when the posted invoice was reversed","example":null},"reversedAt":{"type":["string","null"],"format":"date-time","description":"When the invoice was reversed","example":null},"reversedByStaffId":{"type":["integer","null"],"description":"Identifier of the staff member who reversed the invoice","example":null},"ar_tran":{"type":"object","description":"Underlying accounts-receivable transaction","required":["id","pmsRef","transactionDate","amount","allocated","clientId","allocatedInCurrency","amountInCurrency","businessEntityId","createdAt","currencyId","customFieldValues","exchangeRate","internalNotes","isActive","isCreatedByAiwyn","isManagedByAiwyn","isPosted","isReconciled","managerStaffId","notes","partnerStaffId","pmsCreatedAt","projectId","responsibleStaffId","type","updatedAt"],"properties":{"id":{"type":"integer","description":"AR transaction identifier","example":45678},"pmsRef":{"type":"string","description":"Practice-management-system reference","example":"AR-2024-045678"},"transactionDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"AR transaction date, as a local date-time with no time-zone offset","example":"2024-12-01T00:00:00"},"amount":{"type":"number","description":"Total transaction amount","example":22000},"allocated":{"type":"number","description":"Amount allocated (applied/paid) against the transaction","example":15000},"clientId":{"type":["integer","null"],"description":"Associated client identifier","example":789},"allocatedInCurrency":{"type":["number","null"],"description":"Applied amount in the transaction currency","example":null},"amountInCurrency":{"type":["number","null"],"description":"Transaction amount in the transaction currency","example":null},"businessEntityId":{"type":["integer","null"],"description":"Identifier of the firm business entity","example":1},"createdAt":{"type":"string","format":"date-time","description":"When the AR transaction was created","example":"2024-05-12T22:50:20.595961+00:00"},"currencyId":{"type":["integer","null"],"description":"Identifier of the currency of the amounts ending in InCurrency. Null when no currency is recorded.","example":null},"customFieldValues":{"type":["object","null"],"description":"Firm-defined custom fields, keyed by field name","example":null},"exchangeRate":{"type":["number","null"],"description":"Exchange rate to the firm currency","example":null},"internalNotes":{"type":["string","null"],"description":"Internal notes on the transaction, visible only to firm staff","example":null},"isActive":{"type":["boolean","null"],"description":"Whether the transaction is active; inactive transactions were deleted or reversed","example":true},"isCreatedByAiwyn":{"type":"boolean","description":"Whether the transaction was created in Aiwyn","example":true},"isManagedByAiwyn":{"type":"boolean","description":"Whether Aiwyn manages the transaction's lifecycle","example":false},"isPosted":{"type":"boolean","description":"Whether the transaction is posted","example":true},"isReconciled":{"type":["boolean","null"],"description":"Whether the transaction is reconciled","example":null},"managerStaffId":{"type":["integer","null"],"description":"Identifier of the manager staff member","example":301},"notes":{"type":["string","null"],"description":"Notes on the transaction visible to the client","example":null},"partnerStaffId":{"type":["integer","null"],"description":"Identifier of the partner staff member","example":302},"pmsCreatedAt":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"When the transaction was created in your practice management system, as a local date-time with no time-zone offset. Null when the system does not provide it; for transactions created in Aiwyn, when Aiwyn created them.","example":"2024-03-22T05:00:00"},"projectId":{"type":["integer","null"],"description":"Identifier of the project the transaction belongs to","example":2514},"responsibleStaffId":{"type":["integer","null"],"description":"Identifier of the responsible staff member","example":303},"type":{"type":"string","description":"AR transaction type, for example Invoice, Receipt, Credit, Debit, LateFee, ProcessingFee, Refund, Dispute, DraftInvoice, Prepayment, ReceiptAdj, BadDebt, InternationalFee, LateFeeReversal or Unknown","example":"Invoice"},"updatedAt":{"type":"string","format":"date-time","description":"When the AR transaction was last updated","example":"2024-05-12T22:50:20.595961+00:00"}}}}}}},"id":"schema_63"},"schema_64":{"kind":"json-schema","data":{"type":"object","required":["code","error"],"properties":{"path":{"type":"string","example":"$"},"error":{"type":"string","example":"invalid input syntax for type integer: \"abc\""},"code":{"type":"string","example":"data-exception"}}},"id":"schema_64"},"schema_65":{"kind":"json-schema","data":{"type":"string"},"id":"schema_65"},"schema_66":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","properties":{"client":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":7720},"clientRef":{"type":"string","example":"ACME-001"},"name":{"type":"string","example":"Acme Corporation"}}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice identifier, accepted by the payment link endpoint as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"}],"type":"paragraph"}],"example":125890},"invoiceNumber":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invoice number, accepted by the payment link endpoint as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"}],"type":"paragraph"}],"example":"INV-2026-4850"},"description":{"type":["string","null"],"example":"2025 individual tax return"},"status":{"type":"string","enum":["POSTED","CLOSED","CANCEL","REVERSED"],"example":"POSTED"},"transactionDate":{"type":"string","format":"date","example":"2026-08-01"},"dueDate":{"type":["string","null"],"format":"date","example":"2026-08-31"},"amount":{"type":"string","description":"Invoice total, decimal string","example":"1250.00"},"allocated":{"type":"string","description":"Amount already paid or credited against the invoice, decimal string","example":"250.00"},"outstanding":{"type":"string","description":"Amount still owed, decimal string","example":"1000.00"}}}}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_66"},"schema_67":{"kind":"json-schema","data":{"type":"object","required":["payments","total"],"properties":{"payments":{"type":"array","items":{"type":"object","required":["payment_ar_tran_id","ar_transaction_date","client_name","client_ref","invoice_numbers","is_aiwyn_payment","is_partial_payment","is_payment_success","notes","engagement_names","paid_by_full_name","payment_payment_method","payment_pp_id","refund_date","refund_status","staff_admin_id","status","total_bill_amount","amount","principal","total_processing_fee_amount","total_international_fee_amount","total_late_fee_amount","is_posted","posted_to_bank_dt","estimated_deposit_date","dispute_status","dispute_refund_date","total_bill_amount_in_currency","amount_in_currency","principal_in_currency","total_processing_fee_amount_in_currency","total_international_fee_amount_in_currency","total_late_fee_amount_in_currency","currency_code","card_type","last4","failure_reason","failed_at","payment_confirmation_date","payment_source","payment"],"properties":{"payment_ar_tran_id":{"type":"integer","description":"AR transaction id of the payment","example":1048},"ar_transaction_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Date/time of the AR transaction, as a local date-time with no time-zone offset","example":"2026-09-01T15:00:34.317714"},"client_name":{"type":"string","description":"Name of the client the payment belongs to","example":"Acme Corporation"},"client_ref":{"type":"string","description":"External client reference number","example":"1337"},"invoice_numbers":{"type":["string","null"],"description":"Comma-separated invoice numbers the payment is applied to","example":null},"is_aiwyn_payment":{"type":"boolean","description":"Whether the payment was created through Aiwyn","example":true},"is_partial_payment":{"type":"boolean","description":"Whether the payment only partially covers the billed amount","example":false},"is_payment_success":{"type":"boolean","description":"Whether the payment succeeded","example":true},"notes":{"type":["string","null"],"description":"Free-text notes on the payment","example":"Paid by check"},"engagement_names":{"type":["string","null"],"description":"Names of engagements associated with the payment","example":null},"paid_by_full_name":{"type":["string","null"],"description":"Full name of the payer","example":"Jane Doe"},"payment_payment_method":{"type":["string","null"],"description":"Human-readable payment method","example":"Bank Transfer"},"payment_pp_id":{"type":["string","null"],"description":"Payment processor (Stripe) identifier","example":"pi_3UAtArIog7gyKVjp2xxxxxx"},"refund_date":{"type":["string","null"],"description":"Date of refund, if refunded","example":null},"refund_status":{"type":["string","null"],"description":"Refund status, if refunded","example":null},"staff_admin_id":{"type":"boolean","description":"Staff/admin association flag","example":true},"status":{"type":"string","description":"Human-readable payment status","example":"Completed"},"total_bill_amount":{"type":["number","null"],"description":"Total billed amount","example":null},"amount":{"type":"number","description":"Payment amount","example":10},"principal":{"type":"number","description":"Principal portion of the payment","example":10},"total_processing_fee_amount":{"type":"number","description":"Total processing fee amount","example":0},"total_international_fee_amount":{"type":"number","description":"Total international fee amount","example":0},"total_late_fee_amount":{"type":"number","description":"Total late fee amount","example":0},"is_posted":{"type":"boolean","description":"Whether the payment has been posted to the bank","example":false},"posted_to_bank_dt":{"type":["string","null"],"format":"date-time","description":"Date/time the payment was posted to the bank","example":null},"estimated_deposit_date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Estimated deposit date, as a local date-time with no time-zone offset","example":null},"dispute_status":{"type":["string","null"],"description":"Dispute status, if disputed","example":null},"dispute_refund_date":{"type":["string","null"],"description":"Date of dispute-related refund, if any","example":null},"total_bill_amount_in_currency":{"type":["number","null"],"description":"Total billed amount in the payment's currency","example":null},"amount_in_currency":{"type":["number","null"],"description":"Payment amount in the payment's currency","example":null},"principal_in_currency":{"type":["number","null"],"description":"Principal portion in the payment's currency","example":null},"total_processing_fee_amount_in_currency":{"type":["number","null"],"description":"Total processing fee in the payment's currency","example":null},"total_international_fee_amount_in_currency":{"type":["number","null"],"description":"Total international fee in the payment's currency","example":null},"total_late_fee_amount_in_currency":{"type":["number","null"],"description":"Total late fee in the payment's currency","example":null},"currency_code":{"type":["string","null"],"description":"ISO currency code of the payment","example":null},"card_type":{"type":["string","null"],"description":"Card brand for card payments (for example visa), or the bank name for bank payments, as reported by the payment processor","example":"visa"},"last4":{"type":["string","null"],"description":"Last four digits of the card or account used for the payment","example":"4242"},"failure_reason":{"type":["string","null"],"description":"Why the payment failed","example":null},"failed_at":{"type":["string","null"],"format":"date-time","description":"When the payment failed","example":null},"payment_confirmation_date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"When the payment was confirmed, as a local date-time with no time-zone offset. Determines whether a payment counts as completed or still pending.","example":"2026-09-01T15:00:34.317714"},"payment_source":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How the payment was made: MANUAL, AUTO_PAY, SCHEDULED, AUTO_DRAFT, PAYMENT_LINK, CLIENT_PORTAL, PRE_PAYMENT or UNSPECIFIED"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"CLIENT_PORTAL"},"payment":{"type":"object","description":"Details from the payment record behind this row","required":["application_fee_amount","company_name","created_at","created_by_contact_id","created_by_staff_id","firm_bank_account_id","is_manual","payor_name","posted_to_bank","refunded_amount","updated_at"],"properties":{"application_fee_amount":{"type":["number","null"],"description":"Processor application fee charged on the payment","example":null},"company_name":{"type":["string","null"],"description":"Company name of the payer","example":null},"created_at":{"type":"string","format":"date-time","description":"When the payment record was created","example":"2026-09-01T15:00:34.317714+00:00"},"created_by_contact_id":{"type":["integer","null"],"description":"Contact who made the payment","example":null},"created_by_staff_id":{"type":["integer","null"],"description":"Staff member who recorded the payment","example":null},"firm_bank_account_id":{"type":["integer","null"],"description":"Firm bank account the payment was deposited into; often empty because not every firm records it","example":null},"is_manual":{"type":["boolean","null"],"description":"Whether the payment was recorded manually rather than taken through the gateway","example":false},"payor_name":{"type":["string","null"],"description":"Name of the payer","example":null},"posted_to_bank":{"type":["boolean","null"],"description":"Whether the payment was posted to the bank","example":false},"refunded_amount":{"type":["number","null"],"description":"Amount refunded","example":null},"updated_at":{"type":"string","format":"date-time","description":"When the payment record was last updated","example":"2026-09-01T15:00:34.317714+00:00"}}}}}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of payment records","example":97}}}}}}},"id":"schema_67"},"schema_68":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex payment filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"payment_payment_method":{"_ilike":"%card%"}},{"client_name":{"_ilike":"%Acme%"}}]},{"is_payment_success":{"_eq":true}},{"ar_transaction_date":{"_gte":"1900-01-01T00:00:00"}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":"Dynamic ordering specifications","example":[{"ar_transaction_date":"desc"},{"client_name":"asc"}]}}},"id":"schema_68"},"schema_69":{"kind":"json-schema","data":{"type":"object","required":["payments","total"],"properties":{"payments":{"type":"array","items":{"type":"object","required":["payment_ar_tran_id","ar_transaction_date","client_name","client_ref","invoice_numbers","is_aiwyn_payment","is_partial_payment","is_payment_success","notes","engagement_names","paid_by_full_name","payment_payment_method","payment_pp_id","refund_date","refund_status","staff_admin_id","status","total_bill_amount","amount","principal","total_processing_fee_amount","total_international_fee_amount","total_late_fee_amount","is_posted","posted_to_bank_dt","estimated_deposit_date","dispute_status","dispute_refund_date","total_bill_amount_in_currency","amount_in_currency","principal_in_currency","total_processing_fee_amount_in_currency","total_international_fee_amount_in_currency","total_late_fee_amount_in_currency","currency_code","card_type","last4","failure_reason","failed_at","payment_confirmation_date","payment_source","payment"],"properties":{"payment_ar_tran_id":{"type":"integer","description":"AR transaction id of the payment","example":1048},"ar_transaction_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Date/time of the AR transaction, as a local date-time with no time-zone offset","example":"2026-09-01T15:00:34.317714"},"client_name":{"type":"string","description":"Name of the client the payment belongs to","example":"Acme Corporation"},"client_ref":{"type":"string","description":"External client reference number","example":"1337"},"invoice_numbers":{"type":["string","null"],"description":"Comma-separated invoice numbers the payment is applied to","example":null},"is_aiwyn_payment":{"type":"boolean","description":"Whether the payment was created through Aiwyn","example":true},"is_partial_payment":{"type":"boolean","description":"Whether the payment only partially covers the billed amount","example":false},"is_payment_success":{"type":"boolean","description":"Whether the payment succeeded","example":true},"notes":{"type":["string","null"],"description":"Free-text notes on the payment","example":"Paid by check"},"engagement_names":{"type":["string","null"],"description":"Names of engagements associated with the payment","example":null},"paid_by_full_name":{"type":["string","null"],"description":"Full name of the payer","example":"Jane Doe"},"payment_payment_method":{"type":["string","null"],"description":"Human-readable payment method","example":"Bank Transfer"},"payment_pp_id":{"type":["string","null"],"description":"Payment processor (Stripe) identifier","example":"pi_3UAtArIog7gyKVjp2cNQXIBJ"},"refund_date":{"type":["string","null"],"description":"Date of refund, if refunded","example":null},"refund_status":{"type":["string","null"],"description":"Refund status, if refunded","example":null},"staff_admin_id":{"type":"boolean","description":"Staff/admin association flag","example":true},"status":{"type":"string","description":"Human-readable payment status","example":"Completed"},"total_bill_amount":{"type":["number","null"],"description":"Total billed amount","example":null},"amount":{"type":"number","description":"Payment amount","example":10},"principal":{"type":"number","description":"Principal portion of the payment","example":10},"total_processing_fee_amount":{"type":"number","description":"Total processing fee amount","example":0},"total_international_fee_amount":{"type":"number","description":"Total international fee amount","example":0},"total_late_fee_amount":{"type":"number","description":"Total late fee amount","example":0},"is_posted":{"type":"boolean","description":"Whether the payment has been posted to the bank","example":false},"posted_to_bank_dt":{"type":["string","null"],"format":"date-time","description":"Date/time the payment was posted to the bank","example":null},"estimated_deposit_date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Estimated deposit date, as a local date-time with no time-zone offset","example":null},"dispute_status":{"type":["string","null"],"description":"Dispute status, if disputed","example":null},"dispute_refund_date":{"type":["string","null"],"description":"Date of dispute-related refund, if any","example":null},"total_bill_amount_in_currency":{"type":["number","null"],"description":"Total billed amount in the payment's currency","example":null},"amount_in_currency":{"type":["number","null"],"description":"Payment amount in the payment's currency","example":null},"principal_in_currency":{"type":["number","null"],"description":"Principal portion in the payment's currency","example":null},"total_processing_fee_amount_in_currency":{"type":["number","null"],"description":"Total processing fee in the payment's currency","example":null},"total_international_fee_amount_in_currency":{"type":["number","null"],"description":"Total international fee in the payment's currency","example":null},"total_late_fee_amount_in_currency":{"type":["number","null"],"description":"Total late fee in the payment's currency","example":null},"currency_code":{"type":["string","null"],"description":"ISO currency code of the payment","example":null},"card_type":{"type":["string","null"],"description":"Card brand for card payments (for example visa), or the bank name for bank payments, as reported by the payment processor","example":"visa"},"last4":{"type":["string","null"],"description":"Last four digits of the card or account used for the payment","example":"4242"},"failure_reason":{"type":["string","null"],"description":"Why the payment failed","example":null},"failed_at":{"type":["string","null"],"format":"date-time","description":"When the payment failed","example":null},"payment_confirmation_date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"When the payment was confirmed, as a local date-time with no time-zone offset. Determines whether a payment counts as completed or still pending.","example":"2026-09-01T15:00:34.317714"},"payment_source":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How the payment was made: MANUAL, AUTO_PAY, SCHEDULED, AUTO_DRAFT, PAYMENT_LINK, CLIENT_PORTAL, PRE_PAYMENT or UNSPECIFIED"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"CLIENT_PORTAL"},"payment":{"type":"object","description":"Details from the payment record behind this row","required":["application_fee_amount","company_name","created_at","created_by_contact_id","created_by_staff_id","firm_bank_account_id","is_manual","payor_name","posted_to_bank","refunded_amount","updated_at"],"properties":{"application_fee_amount":{"type":["number","null"],"description":"Processor application fee charged on the payment","example":null},"company_name":{"type":["string","null"],"description":"Company name of the payer","example":null},"created_at":{"type":"string","format":"date-time","description":"When the payment record was created","example":"2026-09-01T15:00:34.317714+00:00"},"created_by_contact_id":{"type":["integer","null"],"description":"Contact who made the payment","example":null},"created_by_staff_id":{"type":["integer","null"],"description":"Staff member who recorded the payment","example":null},"firm_bank_account_id":{"type":["integer","null"],"description":"Firm bank account the payment was deposited into; often empty because not every firm records it","example":null},"is_manual":{"type":["boolean","null"],"description":"Whether the payment was recorded manually rather than taken through the gateway","example":false},"payor_name":{"type":["string","null"],"description":"Name of the payer","example":null},"posted_to_bank":{"type":["boolean","null"],"description":"Whether the payment was posted to the bank","example":false},"refunded_amount":{"type":["number","null"],"description":"Amount refunded","example":null},"updated_at":{"type":"string","format":"date-time","description":"When the payment record was last updated","example":"2026-09-01T15:00:34.317714+00:00"}}}}}},"total":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of payments matching the where clause","example":12}}}}}}},"id":"schema_69"},"schema_70":{"kind":"json-schema","data":{"type":"object","required":["payment"],"properties":{"payment":{"type":"array","description":"Array containing the matching payment (empty if not found)","maxItems":1,"items":{"type":"object","required":["payment_ar_tran_id","ar_transaction_date","client_name","client_ref","invoice_numbers","is_aiwyn_payment","is_partial_payment","is_payment_success","notes","engagement_names","paid_by_full_name","payment_payment_method","payment_pp_id","refund_date","refund_status","staff_admin_id","status","total_bill_amount","amount","principal","total_processing_fee_amount","total_international_fee_amount","total_late_fee_amount","is_posted","posted_to_bank_dt","estimated_deposit_date","dispute_status","dispute_refund_date","total_bill_amount_in_currency","amount_in_currency","principal_in_currency","total_processing_fee_amount_in_currency","total_international_fee_amount_in_currency","total_late_fee_amount_in_currency","currency_code","card_type","last4","failure_reason","failed_at","payment_confirmation_date","payment_source","payment"],"properties":{"payment_ar_tran_id":{"type":"integer","description":"AR transaction id of the payment (the id used by this endpoint)","example":1048},"ar_transaction_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Date/time of the AR transaction, as a local date-time with no time-zone offset","example":"2026-09-01T15:00:34.317714"},"client_name":{"type":"string","description":"Name of the client the payment belongs to","example":"Acme Corporation"},"client_ref":{"type":"string","description":"External client reference number","example":"1337"},"invoice_numbers":{"type":["string","null"],"description":"Comma-separated invoice numbers the payment is applied to","example":null},"is_aiwyn_payment":{"type":"boolean","description":"Whether the payment was created through Aiwyn","example":true},"is_partial_payment":{"type":"boolean","description":"Whether the payment only partially covers the billed amount","example":false},"is_payment_success":{"type":"boolean","description":"Whether the payment succeeded","example":true},"notes":{"type":["string","null"],"description":"Free-text notes on the payment","example":"Paid by check"},"engagement_names":{"type":["string","null"],"description":"Names of engagements associated with the payment","example":null},"paid_by_full_name":{"type":["string","null"],"description":"Full name of the payer","example":"Jane Doe"},"payment_payment_method":{"type":["string","null"],"description":"Human-readable payment method","example":"Bank Transfer"},"payment_pp_id":{"type":["string","null"],"description":"Payment processor (Stripe) identifier","example":"pi_3UAtArIog7gyKVjp2cNQXIBJ"},"refund_date":{"type":["string","null"],"description":"Date of refund, if refunded","example":null},"refund_status":{"type":["string","null"],"description":"Refund status, if refunded","example":null},"staff_admin_id":{"type":"boolean","description":"Staff/admin association flag","example":true},"status":{"type":"string","description":"Human-readable payment status","example":"Completed"},"total_bill_amount":{"type":["number","null"],"description":"Total billed amount","example":null},"amount":{"type":"number","description":"Payment amount","example":10},"principal":{"type":"number","description":"Principal portion of the payment","example":10},"total_processing_fee_amount":{"type":"number","description":"Total processing fee amount","example":0},"total_international_fee_amount":{"type":"number","description":"Total international fee amount","example":0},"total_late_fee_amount":{"type":"number","description":"Total late fee amount","example":0},"is_posted":{"type":"boolean","description":"Whether the payment has been posted to the bank","example":false},"posted_to_bank_dt":{"type":["string","null"],"format":"date-time","description":"Date/time the payment was posted to the bank","example":null},"estimated_deposit_date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"Estimated deposit date, as a local date-time with no time-zone offset","example":null},"dispute_status":{"type":["string","null"],"description":"Dispute status, if disputed","example":null},"dispute_refund_date":{"type":["string","null"],"description":"Date of dispute-related refund, if any","example":null},"total_bill_amount_in_currency":{"type":["number","null"],"description":"Total billed amount in the payment's currency","example":null},"amount_in_currency":{"type":["number","null"],"description":"Payment amount in the payment's currency","example":null},"principal_in_currency":{"type":["number","null"],"description":"Principal portion in the payment's currency","example":null},"total_processing_fee_amount_in_currency":{"type":["number","null"],"description":"Total processing fee in the payment's currency","example":null},"total_international_fee_amount_in_currency":{"type":["number","null"],"description":"Total international fee in the payment's currency","example":null},"total_late_fee_amount_in_currency":{"type":["number","null"],"description":"Total late fee in the payment's currency","example":null},"currency_code":{"type":["string","null"],"description":"ISO currency code of the payment","example":null},"card_type":{"type":["string","null"],"description":"Card brand for card payments (for example visa), or the bank name for bank payments, as reported by the payment processor","example":"visa"},"last4":{"type":["string","null"],"description":"Last four digits of the card or account used for the payment","example":"4242"},"failure_reason":{"type":["string","null"],"description":"Why the payment failed","example":null},"failed_at":{"type":["string","null"],"format":"date-time","description":"When the payment failed","example":null},"payment_confirmation_date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","description":"When the payment was confirmed, as a local date-time with no time-zone offset. Determines whether a payment counts as completed or still pending.","example":"2026-09-01T15:00:34.317714"},"payment_source":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"How the payment was made: MANUAL, AUTO_PAY, SCHEDULED, AUTO_DRAFT, PAYMENT_LINK, CLIENT_PORTAL, PRE_PAYMENT or UNSPECIFIED"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"CLIENT_PORTAL"},"payment":{"type":"object","description":"Details from the payment record behind this row","required":["application_fee_amount","company_name","created_at","created_by_contact_id","created_by_staff_id","firm_bank_account_id","is_manual","payor_name","posted_to_bank","refunded_amount","updated_at"],"properties":{"application_fee_amount":{"type":["number","null"],"description":"Processor application fee charged on the payment","example":null},"company_name":{"type":["string","null"],"description":"Company name of the payer","example":null},"created_at":{"type":"string","format":"date-time","description":"When the payment record was created","example":"2026-09-01T15:00:34.317714+00:00"},"created_by_contact_id":{"type":["integer","null"],"description":"Contact who made the payment","example":null},"created_by_staff_id":{"type":["integer","null"],"description":"Staff member who recorded the payment","example":null},"firm_bank_account_id":{"type":["integer","null"],"description":"Firm bank account the payment was deposited into; often empty because not every firm records it","example":null},"is_manual":{"type":["boolean","null"],"description":"Whether the payment was recorded manually rather than taken through the gateway","example":false},"payor_name":{"type":["string","null"],"description":"Name of the payer","example":null},"posted_to_bank":{"type":["boolean","null"],"description":"Whether the payment was posted to the bank","example":false},"refunded_amount":{"type":["number","null"],"description":"Amount refunded","example":null},"updated_at":{"type":"string","format":"date-time","description":"When the payment record was last updated","example":"2026-09-01T15:00:34.317714+00:00"}}}}}}}},"id":"schema_70"},"schema_71":{"kind":"json-schema","data":{"type":"object","required":["clientRef"],"properties":{"clientRef":{"type":"string","description":"Client reference of the client the link is for. Exactly one active client must match.","example":"ACME-001"},"invoiceIds":{"type":"array","items":{"type":"integer","format":"int64"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unpaid invoices of the client to lock the link to, by invoice "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". At most 100 invoices per link, counted together with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":[125890]},"invoiceNumbers":{"type":"array","items":{"type":"string"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Unpaid invoices of the client to lock the link to, by invoice number. Resolved to the same invoices as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"; an invoice given both ways is counted once."},"children":[],"type":"text"}],"type":"paragraph"}],"example":["INV-2026-4850"]},"amount":{"type":"string","description":"Amount the payer is asked for, decimal with at most two decimal places. Accepted as a JSON number as well. Omit to let the invoices' outstanding balance drive the amount.","example":"1000.00"},"note":{"type":"string","description":"Free text shown to the payer. Treated as sensitive; it is never written to logs.","example":"2025 individual tax return"},"returnUrl":{"type":"string","format":"uri","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Where the portal sends the payer once the link is paid in full. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"https"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" only, host must be allow-listed for the firm. Requires "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceIds"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"invoiceNumbers"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"amount"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://app.safesend.example/returns/42"},"returnLabel":{"type":"string","maxLength":40,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Name of the destination shown on the return control, plain text. Requires "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"SafeSend"},"returnAutomatically":{"type":"boolean","default":false,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Return on its own after the payment confirmation, after a short countdown, instead of waiting for the payer to press the return button. With "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returnUrl"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" the portal navigates there; without one it closes the payment tab, which only works when your system opened the tab by script. Makes the link a quick payment link even on its own."},"children":[],"type":"text"}],"type":"paragraph"}],"example":true},"metadata":{"type":"object","maxProperties":20,"additionalProperties":{"type":"string","maxLength":500},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Your own key-value pairs, echoed back as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"metadata.paymentLinkMetadata"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" webhook events. At most 20 keys; each key 1 to 40 letters, digits, underscores or hyphens; each value at most 500 printable characters. Never shown to the payer, and delivered only to the subscriptions of the API user that created the link; do not put personal data in it. Makes the link a quick payment link even on its own."},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"returnId":"R-42","taxYear":"2025"}},"expiresInDays":{"type":"integer","format":"int64","enum":[7,14,30,60,90],"description":"Days the link stays payable after it is created. Defaults to 14 when left out. Makes the link a quick payment link even on its own.","example":30}}},"id":"schema_71"},"schema_72":{"kind":"json-schema","data":{"type":"object","properties":{"response":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"URL to hand to the payer. For a quick payment link the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"qpLink"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" query parameter is the link id."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://acme.aiwyn.app/client-portal/payments?qpLink=qpl_9f1c2a7b3d4e5f60718293a4b5c6d7e8"}}},"id":"schema_72"},"schema_73":{"kind":"json-schema","data":{"type":"object","properties":{"message":{"type":"string","example":"The invoice, amount or note provided cannot be used to build a payment link for this client."},"extensions":{"type":"object","properties":{"code":{"type":"integer","example":400},"details":{"type":["object","null"],"properties":{"reason":{"type":"string","example":"RETURN_URL_REQUIRES_OBLIGATION"}}}}}}},"id":"schema_73"},"schema_74":{"kind":"json-schema","data":{"type":"object","properties":{"message":{"type":"string","example":"QUICK_PAYMENT_LINKS_DISABLED: Quick payment links are not enabled for this firm"},"extensions":{"type":"object","properties":{"code":{"type":"integer","example":403},"details":{"type":["object","null"],"properties":{"reason":{"type":"string","example":"QUICK_PAYMENT_LINKS_DISABLED"}}}}}}},"id":"schema_74"},"schema_75":{"kind":"json-schema","data":{"type":"object","properties":{"taskTypes":{"type":"array","description":"List of task types ordered by display name","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the task type","example":1},"pmsRef":{"type":"string","description":"Practice management system reference identifier","example":"TAX-PREP"},"code":{"type":"string","description":"Short code used to identify the task type","example":"TXPRP"},"display":{"type":"string","description":"Human-readable display name","example":"Tax Preparation"},"description":{"type":["string","null"],"description":"Detailed description of the task type","example":"Federal and state income tax preparation"},"billable":{"type":"boolean","description":"Whether time logged under this task type is billable","example":true},"taxable":{"type":"boolean","description":"Whether this task type is subject to tax","example":false},"active":{"type":"boolean","description":"Whether the task type is currently active","example":true},"customHourlyRate":{"type":["number","null"],"format":"decimal","description":"Optional custom hourly rate that overrides the default rate","example":275},"rateTypeId":{"type":["integer","null"],"format":"int64","description":"ID of the rate type associated with this task type","example":3},"taskTypeCategoryId":{"type":["integer","null"],"format":"int64","description":"ID of the task type category","example":2},"serviceLineId":{"type":["integer","null"],"format":"int64","description":"ID of the service line this task type belongs to","example":5},"projectsUsedInCount":{"type":"integer","description":"Number of projects this task type is used in","example":42},"invoicesUsedInCount":{"type":"integer","description":"Number of invoices this task type appears on","example":118},"isCreatedByAiwyn":{"type":"boolean","description":"Whether this task type was created by Aiwyn","example":false},"isManagedByAiwyn":{"type":"boolean","description":"Whether this task type is managed by Aiwyn","example":false},"createdAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task type was created","example":"2023-01-15T08:00:00Z"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task type was last updated","example":"2024-06-01T12:30:00Z"},"version":{"type":"integer","format":"int64","description":"Optimistic locking version number","example":3},"createdByStaffId":{"type":["integer","null"],"description":"ID of the staff member who created the task type","example":412},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the task type","example":415}}}},"total":{"type":"object","description":"Aggregate count information","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of task types","example":25}}}}}}},"id":"schema_75"},"schema_76":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count)."},"children":[],"type":"text"}],"type":"paragraph"}],"example":25},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns an"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"empty result array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for filtering. Supports operators such as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_eq"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_neq"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_in"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_nin"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_ilike"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_gte"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_lte"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and logical combinators "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_and"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_or"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_not"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"billable":{"_eq":true}},{"active":{"_eq":true}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Dynamic ordering specifications. Each element is an object mapping a field name to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"asc\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"desc\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Defaults to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"[{ \"display\": \"asc\" }]"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":[{"display":"asc"}]}}},"id":"schema_76"},"schema_77":{"kind":"json-schema","data":{"type":"object","properties":{"taskTypes":{"type":"array","description":"List of task types matching the filter criteria","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the task type","example":1},"pmsRef":{"type":"string","description":"Practice management system reference identifier","example":"TAX-PREP"},"code":{"type":"string","description":"Short code used to identify the task type","example":"TXPRP"},"display":{"type":"string","description":"Human-readable display name","example":"Tax Preparation"},"description":{"type":["string","null"],"description":"Detailed description of the task type","example":"Federal and state income tax preparation"},"billable":{"type":"boolean","description":"Whether time logged under this task type is billable","example":true},"taxable":{"type":"boolean","description":"Whether this task type is subject to tax","example":false},"active":{"type":"boolean","description":"Whether the task type is currently active","example":true},"customHourlyRate":{"type":["number","null"],"format":"decimal","description":"Optional custom hourly rate that overrides the default rate","example":275},"rateTypeId":{"type":["integer","null"],"format":"int64","description":"ID of the rate type associated with this task type","example":3},"taskTypeCategoryId":{"type":["integer","null"],"format":"int64","description":"ID of the task type category","example":2},"serviceLineId":{"type":["integer","null"],"format":"int64","description":"ID of the service line this task type belongs to","example":5},"projectsUsedInCount":{"type":"integer","description":"Number of projects this task type is used in","example":42},"invoicesUsedInCount":{"type":"integer","description":"Number of invoices this task type appears on","example":118},"isCreatedByAiwyn":{"type":"boolean","description":"Whether this task type was created by Aiwyn","example":false},"isManagedByAiwyn":{"type":"boolean","description":"Whether this task type is managed by Aiwyn","example":false},"createdAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task type was created","example":"2023-01-15T08:00:00Z"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task type was last updated","example":"2024-06-01T12:30:00Z"},"version":{"type":"integer","format":"int64","description":"Optimistic locking version number","example":3},"createdByStaffId":{"type":["integer","null"],"description":"ID of the staff member who created the task type","example":412},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the task type","example":415}}}},"total":{"type":"object","description":"Aggregate count matching the filter (ignores pagination)","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of task types matching the where clause","example":12}}}}}}},"id":"schema_77"},"schema_78":{"kind":"json-schema","data":{"type":"integer","format":"int32","minimum":1},"id":"schema_78"},"schema_79":{"kind":"json-schema","data":{"type":"object","required":["tasks"],"properties":{"tasks":{"type":"array","description":"Single-element array containing the matching task (empty if not found)","items":{"type":"object","required":["id","name","overrideName","status","pmsRef","jobId","taskTypeId","assigneeStaffId","startDate","dueDate","targetStartDate","targetDueDate","estimatedHours","completedAt","description","ordinal","parentTaskId","jobTemplateTaskId","isCreatedByAiwyn","isManagedByAiwyn","createdAt","updatedAt","createdByStaffId","lastUpdatedByStaffId","taskSectionId","task","taskType","assigneeStaff","job"],"properties":{"id":{"type":"integer","format":"int32","description":"Unique identifier of the task","example":456},"name":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Task name from the task row. Null when the task's name is carried in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"overrideName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"Q4 Financial Statement Review"},"overrideName":{"type":["string","null"],"description":"Optional name that overrides the default task name","example":null},"status":{"type":"string","description":"Current status of the task","example":"IN_PROGRESS"},"pmsRef":{"type":["string","null"],"description":"Practice management system reference identifier","example":"TASK-001"},"jobId":{"type":["integer","null"],"format":"int64","description":"ID of the job this task belongs to","example":67890},"taskTypeId":{"type":["integer","null"],"format":"int64","description":"ID of the task type","example":1},"assigneeStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the staff member assigned to this task","example":123},"startDate":{"type":["string","null"],"format":"date","description":"Actual start date of the task","example":"2024-10-01"},"dueDate":{"type":["string","null"],"format":"date","description":"Actual due date of the task","example":"2024-12-31"},"targetStartDate":{"type":["string","null"],"format":"date","description":"Planned target start date","example":"2024-09-15"},"targetDueDate":{"type":["string","null"],"format":"date","description":"Planned target due date","example":"2024-12-15"},"estimatedHours":{"type":["number","null"],"format":"decimal","description":"Estimated hours to complete the task","example":40},"completedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task was completed","example":null},"description":{"type":["string","null"],"description":"Detailed description of the task","example":"Review and analyse Q4 financial statements including variance analysis"},"ordinal":{"type":["integer","null"],"description":"Display order position of the task","example":1},"parentTaskId":{"type":["integer","null"],"format":"int32","description":"ID of the parent task if this is a subtask","example":null},"jobTemplateTaskId":{"type":["integer","null"],"format":"int64","description":"ID of the job template task this was created from","example":10},"isCreatedByAiwyn":{"type":"boolean","description":"Whether this task was created by Aiwyn","example":false},"isManagedByAiwyn":{"type":"boolean","description":"Whether this task is managed by Aiwyn","example":false},"createdAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task was created","example":"2024-09-01T08:00:00Z"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task was last updated","example":"2024-10-01T09:30:00Z"},"createdByStaffId":{"type":["integer","null"],"description":"ID of the staff member who created the task","example":412},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the task","example":415},"taskSectionId":{"type":["integer","null"],"description":"ID of the task section","example":8},"task":{"type":["object","null"],"description":"The task's active flag and custom field values","required":["active","customFieldValues"],"properties":{"active":{"type":"boolean","description":"Whether the task is active","example":true},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields, keyed by custom field code"}}},"taskType":{"type":["object","null"],"description":"The task type associated with this task","properties":{"id":{"type":"integer","format":"int64","example":1},"code":{"type":"string","example":"TXPRP"},"display":{"type":"string","example":"Tax Preparation"},"billable":{"type":"boolean","example":true},"taxable":{"type":"boolean","example":false},"active":{"type":"boolean","example":true}}},"assigneeStaff":{"type":["object","null"],"description":"The staff member assigned to this task","properties":{"id":{"type":"integer","format":"int64","example":123},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Smith"},"email":{"type":["string","null"],"format":"email","example":"john.smith@firm.com"}}},"job":{"type":["object","null"],"description":"The job this task belongs to","properties":{"id":{"type":"integer","format":"int64","example":67890}}}}}}}},"id":"schema_79"},"schema_80":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count)."},"children":[],"type":"text"}],"type":"paragraph"}],"example":25},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns an"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"empty result array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for filtering. Supports operators such as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_eq"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_neq"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_in"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_nin"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_ilike"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_gte"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_lte"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", and logical combinators "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_and"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_or"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"_not"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Nested relations "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"taskType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"job"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" can be filtered inline."},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"taskType":{"code":{"_eq":"PREP"}}},{"assigneeStaffId":{"_eq":789}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Dynamic ordering specifications. Each element maps a field name to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"asc\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"desc\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Defaults to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"[{ \"id\": \"asc\" }]"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":[{"dueDate":"asc"}]}}},"id":"schema_80"},"schema_81":{"kind":"json-schema","data":{"type":"object","required":["tasks","total"],"properties":{"tasks":{"type":"array","description":"List of tasks matching the filter criteria","items":{"type":"object","required":["id","name","overrideName","status","pmsRef","jobId","taskTypeId","assigneeStaffId","startDate","dueDate","targetStartDate","targetDueDate","estimatedHours","completedAt","description","ordinal","parentTaskId","isCreatedByAiwyn","isManagedByAiwyn","createdAt","updatedAt","createdByStaffId","lastUpdatedByStaffId","taskSectionId","jobTemplateTaskId","task","taskType","assigneeStaff","job"],"properties":{"id":{"type":"integer","format":"int32","description":"Unique identifier of the task","example":456},"name":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Task name from the task row. Null when the task's name is carried in "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"overrideName"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"Q4 Financial Statement Review"},"overrideName":{"type":["string","null"],"description":"Optional name that overrides the default task name","example":null},"status":{"type":"string","description":"Current status of the task","example":"IN_PROGRESS"},"pmsRef":{"type":["string","null"],"description":"Practice management system reference identifier","example":"TASK-001"},"jobId":{"type":["integer","null"],"format":"int64","description":"ID of the job this task belongs to","example":67890},"taskTypeId":{"type":["integer","null"],"format":"int64","description":"ID of the task type","example":1},"assigneeStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the staff member assigned to this task","example":789},"startDate":{"type":["string","null"],"format":"date","description":"Actual start date of the task","example":"2024-10-01"},"dueDate":{"type":["string","null"],"format":"date","description":"Actual due date of the task","example":"2024-12-31"},"targetStartDate":{"type":["string","null"],"format":"date","description":"Planned target start date","example":"2024-09-15"},"targetDueDate":{"type":["string","null"],"format":"date","description":"Planned target due date","example":"2024-12-15"},"estimatedHours":{"type":["number","null"],"format":"decimal","description":"Estimated hours to complete the task","example":40},"completedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task was completed","example":null},"description":{"type":["string","null"],"description":"Detailed description of the task","example":"Review and analyse Q4 financial statements"},"ordinal":{"type":["integer","null"],"description":"Display order position of the task","example":1},"parentTaskId":{"type":["integer","null"],"format":"int32","description":"ID of the parent task if this is a subtask","example":null},"isCreatedByAiwyn":{"type":"boolean","description":"Whether this task was created by Aiwyn","example":false},"isManagedByAiwyn":{"type":"boolean","description":"Whether this task is managed by Aiwyn","example":false},"createdAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task was created","example":"2024-09-01T08:00:00Z"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the task was last updated","example":"2024-10-01T09:30:00Z"},"createdByStaffId":{"type":["integer","null"],"description":"ID of the staff member who created the task","example":412},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the task","example":415},"taskSectionId":{"type":["integer","null"],"description":"ID of the task section","example":8},"jobTemplateTaskId":{"type":["integer","null"],"format":"int64","description":"ID of the project template task this task was created from","example":10},"task":{"type":["object","null"],"description":"The task's active flag and custom field values","required":["active","customFieldValues"],"properties":{"active":{"type":"boolean","description":"Whether the task is active","example":true},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields, keyed by custom field code"}}},"taskType":{"type":["object","null"],"description":"The task type associated with this task","properties":{"id":{"type":"integer","format":"int64","example":1},"code":{"type":"string","example":"PREP"},"display":{"type":"string","example":"Tax Preparation"},"billable":{"type":"boolean","example":true},"taxable":{"type":"boolean","example":false},"active":{"type":"boolean","example":true}}},"assigneeStaff":{"type":["object","null"],"description":"The staff member assigned to this task","properties":{"id":{"type":"integer","format":"int64","example":789},"firstName":{"type":"string","example":"Jane"},"lastName":{"type":"string","example":"Doe"},"email":{"type":["string","null"],"format":"email","example":"jane.doe@firm.com"}}},"job":{"type":["object","null"],"description":"The job this task belongs to","properties":{"id":{"type":"integer","format":"int64","example":67890}}}}}},"total":{"type":"object","description":"Aggregate count matching the filter (ignores pagination)","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of tasks matching the where clause","example":84}}}}}}},"id":"schema_81"},"schema_82":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":25},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns an"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"empty result array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0}}},"id":"schema_82"},"schema_83":{"kind":"json-schema","data":{"type":"object","patternProperties":{"^[a-z0-9_]+_vw_wip_unified$":{"type":"array","items":{"type":"object","required":["id","wipType","loggedDate","wipValue","wipValueOutstanding","billedAmount","writeOffAmount","notes","clientId","jobId","isActive","createdAt","updatedAt","approvedDate","approvedStaffId","billedPerUnit","costPerUnit","customFieldValues","deptId","isApproved","isCreatedByAiwyn","isLocked","isManagedByAiwyn","isPosted","loggedStaffId","officeId","pmsRef","postedDate","postedStaffId","rawUnits","serviceLineId","staffTypeId","taskTypeId","units","updatedByStaffId","client"],"properties":{"id":{"type":"integer","description":"Unique WIP record identifier","example":850321},"wipType":{"type":"string","description":"Type of WIP entry","example":"Time"},"loggedDate":{"type":"string","format":"date-time","description":"Date when WIP was logged","example":"2024-01-17T05:00:00"},"wipValue":{"type":"number","format":"decimal","description":"Original WIP value recorded","example":1250},"wipValueOutstanding":{"type":"number","format":"decimal","description":"Outstanding WIP value yet to be billed","example":0},"billedAmount":{"type":"number","format":"decimal","description":"Amount that has been billed from this WIP","example":1225},"writeOffAmount":{"type":"number","format":"decimal","description":"Amount written off as uncollectible","example":25},"notes":{"type":["string","null"],"description":"Additional notes or description for the WIP entry","example":"Consultation and analysis for Q1 financial review"},"clientId":{"type":["integer","null"],"description":"Associated client identifier. Null when the entry is not linked to a client.","example":1561},"jobId":{"type":["integer","null"],"description":"Associated job identifier. Null when the entry is not linked to a job, as is usual for an expense.","example":2514},"isActive":{"type":"boolean","description":"Whether the WIP record is active (inactive records represent deletions)","example":true},"createdAt":{"type":"string","format":"date-time","description":"WIP record creation timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"WIP record last update timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"approvedDate":{"type":["string","null"],"format":"date-time","description":"When the WIP record was approved","example":"2024-01-18T05:00:00"},"approvedStaffId":{"type":["integer","null"],"description":"ID of the staff member who approved the WIP record","example":412},"billedPerUnit":{"type":["number","null"],"format":"decimal","description":"Billing rate per unit","example":250},"costPerUnit":{"type":["number","null"],"format":"decimal","description":"Cost per unit of the WIP record","example":95},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields, keyed by custom field code"},"deptId":{"type":["integer","null"],"description":"ID of the department","example":3},"isApproved":{"type":["boolean","null"],"description":"Whether the WIP record is approved","example":true},"isCreatedByAiwyn":{"type":["boolean","null"],"description":"Whether the WIP record was created in Aiwyn","example":false},"isLocked":{"type":["boolean","null"],"description":"Whether the WIP record is locked","example":false},"isManagedByAiwyn":{"type":["boolean","null"],"description":"Whether Aiwyn manages the WIP record's lifecycle","example":false},"isPosted":{"type":["boolean","null"],"description":"Whether the WIP record is posted","example":true},"loggedStaffId":{"type":["integer","null"],"description":"ID of the staff member the WIP record was logged for","example":412},"officeId":{"type":["integer","null"],"description":"ID of the office","example":2},"pmsRef":{"type":["string","null"],"description":"Identifier of the WIP record in the external practice management system","example":"1789456"},"postedDate":{"type":["string","null"],"format":"date-time","description":"When the WIP record was posted","example":"2024-01-19T05:00:00"},"postedStaffId":{"type":["integer","null"],"description":"ID of the staff member who posted the WIP record","example":415},"rawUnits":{"type":["number","null"],"description":"Units before rounding","example":5},"serviceLineId":{"type":["integer","null"],"description":"ID of the service line","example":4},"staffTypeId":{"type":["integer","null"],"description":"ID of the staff type","example":7},"taskTypeId":{"type":["integer","null"],"description":"ID of the work code (task type)","example":12},"units":{"type":["number","null"],"description":"Units (hours for time entries)","example":5},"updatedByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the WIP record","example":415},"client":{"type":["object","null"],"description":"Associated client information. Null when the client is not in the client view (for example an inactive client).","required":["id","name"],"properties":{"id":{"type":"integer","example":1561},"name":{"type":"string","example":"TechFlow Enterprises"}}}}}},"^[a-z0-9_]+_vw_wip_unified_aggregate$":{"type":"object","properties":{"aggregate":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of WIP records matching criteria","example":84},"sum":{"type":"object","properties":{"wipValue":{"type":"number","format":"decimal","description":"Total WIP value across all matching records","example":24186.15},"billedAmount":{"type":"number","format":"decimal","description":"Total billed amount across all matching records","example":19612.07},"wipValueOutstanding":{"type":"number","format":"decimal","description":"Total outstanding WIP value","example":0}}}}}}}}},"id":"schema_83"},"schema_84":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" returns an"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex WIP filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"wipType":{"_in":["Time","Expense"]}},{"notes":{"_ilike":"%consultation%"}}]},{"isActive":{"_eq":true}},{"loggedDate":{"_gte":"1900-01-01T00:00:00Z"}},{"clientId":{"_in":[1001,1002,1003]}}]}},"orderBy":{"type":"array","items":{"type":"object"},"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Dynamic ordering specifications. Defaults to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"[{ \"loggedDate\": \"desc\" }, { \"createdAt\": \"desc\" }]"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":[{"loggedDate":"desc"},{"wipValue":"desc"}]}}},"id":"schema_84"},"schema_85":{"kind":"json-schema","data":{"type":"object","required":["wips","total"],"properties":{"wips":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"WIP records matching the filter (at most "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"paragraph"}],"items":{"type":"object","required":["id","wipType","loggedDate","wipValue","wipValueOutstanding","billedAmount","writeOffAmount","notes","clientId","jobId","isActive","createdAt","updatedAt","approvedDate","approvedStaffId","billedPerUnit","costPerUnit","customFieldValues","deptId","isApproved","isCreatedByAiwyn","isLocked","isManagedByAiwyn","isPosted","loggedStaffId","officeId","pmsRef","postedDate","postedStaffId","rawUnits","serviceLineId","staffTypeId","taskTypeId","units","updatedByStaffId","client"],"properties":{"id":{"type":"integer","description":"Unique WIP record identifier","example":89012},"wipType":{"type":"string","description":"Type of WIP entry","example":"Progress"},"loggedDate":{"type":"string","format":"date-time","description":"Date when WIP was logged","example":"2024-01-17T05:00:00"},"wipValue":{"type":"number","format":"decimal","description":"Original WIP value recorded","example":1250},"wipValueOutstanding":{"type":"number","format":"decimal","description":"Outstanding WIP value yet to be billed","example":0},"billedAmount":{"type":"number","format":"decimal","description":"Amount that has been billed from this WIP","example":1225},"writeOffAmount":{"type":"number","format":"decimal","description":"Amount written off as uncollectible","example":25},"notes":{"type":["string","null"],"description":"Additional notes or description for the WIP entry","example":"Consultation and analysis for Q1 financial review"},"clientId":{"type":["integer","null"],"description":"Associated client identifier. Null when the entry is not linked to a client.","example":1561},"jobId":{"type":["integer","null"],"description":"Associated job identifier. Null when the entry is not linked to a job, as is usual for an expense.","example":2514},"isActive":{"type":"boolean","description":"Whether the WIP record is active (inactive records represent deletions)","example":true},"createdAt":{"type":"string","format":"date-time","description":"WIP record creation timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"WIP record last update timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"approvedDate":{"type":["string","null"],"format":"date-time","description":"When the WIP record was approved","example":"2024-01-18T05:00:00"},"approvedStaffId":{"type":["integer","null"],"description":"ID of the staff member who approved the WIP record","example":412},"billedPerUnit":{"type":["number","null"],"format":"decimal","description":"Billing rate per unit","example":250},"costPerUnit":{"type":["number","null"],"format":"decimal","description":"Cost per unit of the WIP record","example":95},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields, keyed by custom field code"},"deptId":{"type":["integer","null"],"description":"ID of the department","example":3},"isApproved":{"type":["boolean","null"],"description":"Whether the WIP record is approved","example":true},"isCreatedByAiwyn":{"type":["boolean","null"],"description":"Whether the WIP record was created in Aiwyn","example":false},"isLocked":{"type":["boolean","null"],"description":"Whether the WIP record is locked","example":false},"isManagedByAiwyn":{"type":["boolean","null"],"description":"Whether Aiwyn manages the WIP record's lifecycle","example":false},"isPosted":{"type":["boolean","null"],"description":"Whether the WIP record is posted","example":true},"loggedStaffId":{"type":["integer","null"],"description":"ID of the staff member the WIP record was logged for","example":412},"officeId":{"type":["integer","null"],"description":"ID of the office","example":2},"pmsRef":{"type":["string","null"],"description":"Identifier of the WIP record in the external practice management system","example":"1789456"},"postedDate":{"type":["string","null"],"format":"date-time","description":"When the WIP record was posted","example":"2024-01-19T05:00:00"},"postedStaffId":{"type":["integer","null"],"description":"ID of the staff member who posted the WIP record","example":415},"rawUnits":{"type":["number","null"],"description":"Units before rounding","example":5},"serviceLineId":{"type":["integer","null"],"description":"ID of the service line","example":4},"staffTypeId":{"type":["integer","null"],"description":"ID of the staff type","example":7},"taskTypeId":{"type":["integer","null"],"description":"ID of the work code (task type)","example":12},"units":{"type":["number","null"],"description":"Units (hours for time entries)","example":5},"updatedByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the WIP record","example":415},"client":{"type":["object","null"],"description":"Associated client information. Null when the client is not in the client view (for example an inactive client).","required":["id","name"],"properties":{"id":{"type":"integer","example":1561},"name":{"type":"string","example":"TechFlow Enterprises"}}}}}},"total":{"type":"object","description":"Count and financial aggregates over every record matching the filter (ignores pagination)","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count","sum","avg"],"properties":{"count":{"type":"integer","description":"Total number of WIP records matching the where clause","example":84},"sum":{"type":"object","description":"Sums over the matching records; each is null when nothing matches","required":["wipValue","wipValueOutstanding","billedAmount","writeOffAmount"],"properties":{"wipValue":{"type":["number","null"],"format":"decimal","description":"Total WIP value"},"wipValueOutstanding":{"type":["number","null"],"format":"decimal","description":"Total outstanding WIP value"},"billedAmount":{"type":["number","null"],"format":"decimal","description":"Total billed amount"},"writeOffAmount":{"type":["number","null"],"format":"decimal","description":"Total written-off amount"}}},"avg":{"type":"object","description":"Averages over the matching records; null when nothing matches","required":["wipValue"],"properties":{"wipValue":{"type":["number","null"],"format":"decimal","description":"Average WIP value"}}}}}}}}},"id":"schema_85"},"schema_86":{"kind":"json-schema","data":{"type":"object","required":["error"],"properties":{"path":{"type":"string","description":"JSON path of the failing input","example":"$.selectionSet.wips.args.where.unknownField"},"error":{"type":"string","description":"Human-readable error message","example":"field 'unknownField' not found in type: 'vw_wip_unified_bool_exp'"},"code":{"type":"string","description":"Hasura error code","example":"validation-failed"}}},"id":"schema_86"},"schema_87":{"kind":"json-schema","data":{"type":"object","required":["wip"],"properties":{"wip":{"type":"array","description":"Single-element array containing the matching WIP record (empty if not found)","maxItems":1,"items":{"type":"object","required":["id","wipType","loggedDate","wipValue","wipValueOutstanding","billedAmount","writeOffAmount","notes","clientId","jobId","isActive","createdAt","updatedAt","approvedDate","approvedStaffId","billedPerUnit","costPerUnit","customFieldValues","deptId","isApproved","isCreatedByAiwyn","isLocked","isManagedByAiwyn","isPosted","loggedStaffId","officeId","pmsRef","postedDate","postedStaffId","rawUnits","serviceLineId","staffTypeId","taskTypeId","units","updatedByStaffId","client"],"properties":{"id":{"type":"integer","description":"Unique WIP record identifier","example":89012},"wipType":{"type":"string","description":"Type of WIP entry","example":"Progress"},"loggedDate":{"type":"string","format":"date-time","description":"Date when WIP was logged","example":"2024-01-17T05:00:00"},"wipValue":{"type":"number","format":"decimal","description":"Original WIP value recorded","example":1250},"wipValueOutstanding":{"type":"number","format":"decimal","description":"Outstanding WIP value yet to be billed","example":0},"billedAmount":{"type":"number","format":"decimal","description":"Amount that has been billed from this WIP","example":1225},"writeOffAmount":{"type":"number","format":"decimal","description":"Amount written off as uncollectible","example":25},"notes":{"type":["string","null"],"description":"Additional notes or description for the WIP entry","example":"Consultation and analysis for Q1 financial review"},"clientId":{"type":["integer","null"],"description":"Associated client identifier. Null when the entry is not linked to a client.","example":1561},"jobId":{"type":["integer","null"],"description":"Associated job identifier. Null when the entry is not linked to a job, as is usual for an expense.","example":2514},"isActive":{"type":"boolean","description":"Whether the WIP record is active (inactive records represent deletions)","example":true},"createdAt":{"type":"string","format":"date-time","description":"WIP record creation timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"updatedAt":{"type":"string","format":"date-time","description":"WIP record last update timestamp","example":"2024-05-12T23:02:33.24516+00:00"},"approvedDate":{"type":["string","null"],"format":"date-time","description":"When the WIP record was approved","example":"2024-01-18T05:00:00"},"approvedStaffId":{"type":["integer","null"],"description":"ID of the staff member who approved the WIP record","example":412},"billedPerUnit":{"type":["number","null"],"format":"decimal","description":"Billing rate per unit","example":250},"costPerUnit":{"type":["number","null"],"format":"decimal","description":"Cost per unit of the WIP record","example":95},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields, keyed by custom field code"},"deptId":{"type":["integer","null"],"description":"ID of the department","example":3},"isApproved":{"type":["boolean","null"],"description":"Whether the WIP record is approved","example":true},"isCreatedByAiwyn":{"type":["boolean","null"],"description":"Whether the WIP record was created in Aiwyn","example":false},"isLocked":{"type":["boolean","null"],"description":"Whether the WIP record is locked","example":false},"isManagedByAiwyn":{"type":["boolean","null"],"description":"Whether Aiwyn manages the WIP record's lifecycle","example":false},"isPosted":{"type":["boolean","null"],"description":"Whether the WIP record is posted","example":true},"loggedStaffId":{"type":["integer","null"],"description":"ID of the staff member the WIP record was logged for","example":412},"officeId":{"type":["integer","null"],"description":"ID of the office","example":2},"pmsRef":{"type":["string","null"],"description":"Identifier of the WIP record in the external practice management system","example":"1789456"},"postedDate":{"type":["string","null"],"format":"date-time","description":"When the WIP record was posted","example":"2024-01-19T05:00:00"},"postedStaffId":{"type":["integer","null"],"description":"ID of the staff member who posted the WIP record","example":415},"rawUnits":{"type":["number","null"],"description":"Units before rounding","example":5},"serviceLineId":{"type":["integer","null"],"description":"ID of the service line","example":4},"staffTypeId":{"type":["integer","null"],"description":"ID of the staff type","example":7},"taskTypeId":{"type":["integer","null"],"description":"ID of the work code (task type)","example":12},"units":{"type":["number","null"],"description":"Units (hours for time entries)","example":5},"updatedByStaffId":{"type":["integer","null"],"description":"ID of the staff member who last updated the WIP record","example":415},"client":{"type":["object","null"],"description":"Associated client information. Null when the client is not in the client view (for example an inactive client).","required":["id","name"],"properties":{"id":{"type":"integer","example":1561},"name":{"type":"string","example":"TechFlow Enterprises"}}}}}}}},"id":"schema_87"},"schema_88":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["entityTypes"],"properties":{"entityTypes":{"type":"array","items":{"type":"object","required":["name","displayName","schemaUrl","isCustom"],"properties":{"name":{"type":"string","description":"Name"},"displayName":{"type":"string","description":"Displayname"},"description":{"type":["string","null"],"description":"Description"},"schemaUrl":{"type":"string","description":"Schemaurl"},"isCustom":{"type":"boolean","description":"Iscustom"}}},"description":"Entitytypes"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_88"},"schema_89":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["entityType","fields"],"properties":{"entityType":{"type":"string","description":"Entitytype"},"fields":{"type":"array","items":{"type":"object","required":["name","displayName","type","required","nullable","isForeignKey","isCustomField"],"properties":{"name":{"type":"string","description":"Name"},"displayName":{"type":"string","description":"Displayname"},"type":{"type":"string","description":"Type"},"required":{"type":"boolean","description":"Required"},"nullable":{"type":"boolean","description":"Nullable"},"description":{"type":["string","null"],"description":"Description"},"example":{"type":["string","null"],"description":"Example"},"enumValues":{"type":["array","null"],"items":{"type":"string"},"description":"Enumvalues"},"properties":{"type":["array","null"],"items":{"type":"object"},"description":"Properties"},"isForeignKey":{"type":"boolean","description":"Isforeignkey"},"foreignEntityType":{"type":["string","null"],"description":"Foreignentitytype"},"isCustomField":{"type":"boolean","description":"Iscustomfield"}}},"description":"Fields"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_89"},"schema_90":{"kind":"json-schema","data":{"type":"object","required":["records"],"properties":{"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Type"},"systemRef":{"type":["object","null"],"description":"Systemref"},"attributes":{"type":"object","description":"Attributes"}}},"description":"Records"}}},"id":"schema_90"},"schema_91":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["summary","records"],"properties":{"summary":{"type":"object","description":"Summary"},"records":{"type":"array","items":{"type":"object","required":["type","status"],"properties":{"type":{"type":"string","description":"Type"},"systemRef":{"type":["object","null"],"description":"Systemref"},"status":{"type":"string","description":"Status"},"aiwynId":{"type":["integer","null"],"format":"int64","description":"Aiwynid"},"error":{"type":["object","null"],"description":"Error"}}},"description":"Records"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_91"},"schema_92":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","format":"int32","description":"Pagesize"},"page":{"type":"integer","format":"int32","description":"Page"}}},"id":"schema_92"},"schema_93":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["type","pageSize","page","returned","records"],"properties":{"type":{"type":"string","description":"Type"},"pageSize":{"type":"integer","format":"int32","description":"Pagesize"},"page":{"type":"integer","format":"int32","description":"Page"},"returned":{"type":"integer","format":"int32","description":"Returned"},"records":{"type":"array","items":{"type":"object","required":["type","systemRefs","attributes"],"properties":{"type":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Record type, for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"aiwynId":{"type":["integer","null"],"format":"int64","description":"Aiwyn ID of the record."},"systemRefs":{"type":"array","items":{"type":"object"},"description":"Every reference the record is known by, including its PM reference."},"attributes":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The record's fields. Every value is a string, for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"true\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a boolean."},"children":[],"type":"text"}],"type":"paragraph"}]}}},"description":"Records"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_93"},"schema_94":{"kind":"json-schema","data":{"type":"object","required":["records"],"properties":{"records":{"type":"array","items":{"type":"object","properties":{"systemRef":{"type":["object","null"],"description":"Systemref"},"attributes":{"type":"object","description":"Attributes"}}},"description":"Records"}}},"id":"schema_94"},"schema_95":{"kind":"json-schema","data":{"type":"integer","format":"int64"},"id":"schema_95"},"schema_96":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["type","systemRefs","attributes"],"properties":{"type":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Record type, for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeCode"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"TimeEntry"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"aiwynId":{"type":["integer","null"],"format":"int64","description":"Aiwyn ID of the record."},"systemRefs":{"type":"array","items":{"type":"object","required":["system","reference"],"properties":{"system":{"type":"string","description":"System"},"reference":{"type":"string","description":"Reference"}}},"description":"Every reference the record is known by, including its PM reference."},"attributes":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The record's fields. Every value is a string, for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"true\""},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" for a boolean."},"children":[],"type":"text"}],"type":"paragraph"}]}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_96"},"schema_97":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":50},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}],"example":0}}},"id":"schema_97"},"schema_98":{"kind":"json-schema","data":{"type":"object","required":["staff","total"],"properties":{"staff":{"type":"array","items":{"$ref":"#/components/schemas/StaffDirectoryRecord"}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","description":"Total number of staff records matching criteria","example":138}}}}}}},"id":"schema_98"},"schema_99":{"kind":"json-schema","data":{"type":"object","properties":{"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":50,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Limit — number of records to return (not a page count). Hasura maps this to "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"limit"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}],"example":50},"page":{"type":"integer","minimum":0,"default":0,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Offset — number of records to skip. This is not a page index."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"To fetch the next N rows after the first N, send "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"pageSize: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"page: N"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". An offset at or beyond "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"total.aggregate.count"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"returns an empty result array."},"children":[],"type":"text"}],"type":"paragraph"}]},"where":{"type":"object","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Flexible "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"where"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" clause for complex staff filtering"},"children":[],"type":"text"}],"type":"paragraph"}],"example":{"_and":[{"_or":[{"firstName":{"_ilike":"%john%"}},{"lastName":{"_ilike":"%doe%"}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"deptId":{"_in":[1,2,3]}}]}},"orderBy":{"type":"array","description":"Dynamic ordering specifications with multiple fields","items":{"type":"object"},"example":[{"lastName":"asc"},{"firstName":"asc"}]}}},"id":"schema_99"},"schema_100":{"kind":"json-schema","data":{"type":"object","required":["staff","total"],"properties":{"staff":{"type":"array","items":{"$ref":"#/components/schemas/StaffDirectoryRecord"}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","description":"Total number of staff records matching criteria","example":1}}}}}}},"id":"schema_100"},"schema_101":{"kind":"json-schema","data":{"type":"object","required":["staff"],"properties":{"staff":{"anyOf":[{"$ref":"#/components/schemas/StaffDirectoryRecord"},{"type":"null"}]}}},"id":"schema_101"},"schema_102":{"kind":"json-schema","data":{"type":"object","required":["firstName","lastName","pmsRef","ref"],"properties":{"firstName":{"type":"string","description":"Staff member's first name","example":"Jane"},"lastName":{"type":"string","description":"Staff member's last name","example":"Doe"},"pmsRef":{"type":"string","description":"Practice management system reference identifier","example":"EMP-1042"},"ref":{"type":"string","description":"Unique staff reference code","example":"doe-j"},"email":{"type":["string","null"],"format":"email","description":"Primary email address","example":"jane.doe@firm.com"},"jobTitle":{"type":["string","null"],"description":"Job title (free-text)","example":"Senior Associate"},"jobTitleId":{"type":["integer","null"],"format":"int64","description":"ID of a job title lookup record","example":7},"departmentId":{"type":["integer","null"],"format":"int64","description":"ID of the department this staff member belongs to","example":3},"officeId":{"type":["integer","null"],"format":"int64","description":"ID of the office this staff member is based in","example":2},"orgId":{"type":["integer","null"],"format":"int64","description":"ID of the organization","example":1},"serviceLineId":{"type":["integer","null"],"format":"int64","description":"ID of the service line","example":4},"staffTypeId":{"type":["integer","null"],"format":"int64","description":"ID of the staff type (e.g. Partner, Manager, Associate)","example":2},"partnerStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the partner staff member assigned to this person","example":50},"managerStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the manager staff member","example":30},"supervisorStaffId":{"type":["integer","null"],"format":"int64","description":"ID of the supervisor staff member","example":null},"prefix":{"type":["string","null"],"description":"Name prefix (e.g. Dr., Ms.)","example":"Ms."},"startDate":{"type":["string","null"],"format":"date-time","description":"Employment start date","example":"2024-01-15T00:00:00"},"endDate":{"type":["string","null"],"format":"date-time","description":"Employment end date","example":null},"active":{"type":"boolean","default":true,"description":"Whether the staff member is active","example":true},"rateCardAssignment":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Optional rate card assignment. When provided, billing rate and average"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"cost records are created atomically with the staff record."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and all "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values must reference existing records"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"or the entire request is rejected with HTTP 400."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["rateCardId","billingRates"],"properties":{"rateCardId":{"type":"integer","format":"int64","description":"ID of an existing rate card to assign this staff member to","example":5},"billingRates":{"type":"array","description":"One billing rate record per rate type. Can be an empty array if only an average cost is being set.\n","items":{"type":"object","required":["rateTypeId"],"properties":{"rateTypeId":{"type":"integer","format":"int64","description":"ID of an existing rate type","example":12},"hourlyBillingRate":{"type":["number","null"],"format":"decimal","description":"Hourly billing rate in the firm's currency. Defaults to 0 when omitted.","example":150}}}},"averageCost":{"type":["number","null"],"format":"decimal","description":"Average hourly cost for this staff member. One record per rate card assignment.","example":75}}}}},"id":"schema_102"},"schema_103":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier of the created staff member","example":312},"pmsRef":{"type":"string","example":"EMP-1042"},"ref":{"type":"string","example":"doe-j"},"firstName":{"type":"string","example":"Jane"},"lastName":{"type":"string","example":"Doe"},"fullName":{"type":["string","null"],"example":"Jane Doe"},"email":{"type":["string","null"],"format":"email","example":"jane.doe@firm.com"},"jobTitle":{"type":["string","null"],"example":"Senior Associate"},"departmentId":{"type":["integer","null"],"format":"int64","example":null},"officeId":{"type":["integer","null"],"format":"int64","example":null},"active":{"type":"boolean","example":true},"version":{"type":"integer","format":"int64","description":"Record version. A newly onboarded staff member has version 0; updates through this API do not change it.","example":0},"createdAt":{"type":["string","null"],"format":"date-time","example":"2024-03-15T10:00:00Z"},"updatedAt":{"type":["string","null"],"format":"date-time","example":"2024-03-15T10:00:00Z"},"rateCardAssignment":{"type":["object","null"],"description":"Present only when a rate card assignment was provided in the request","properties":{"rateCardId":{"type":"integer","format":"int64","description":"ID of the rate card the staff member was assigned to","example":5},"billingRateIds":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"IDs of the created rate_card_staff_billing_rate records"},"children":[],"type":"text"}],"type":"paragraph"}],"items":{"type":"integer","format":"int64"},"example":[101,102]},"averageCostId":{"type":["integer","null"],"format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ID of the created rate_card_staff_average_cost record, or null if averageCost was not provided"},"children":[],"type":"text"}],"type":"paragraph"}],"example":201}}}}},"meta":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Staff member created successfully"},"timestamp":{"type":"string","format":"date-time","example":"2024-03-15T10:00:00Z"},"version":{"type":"string","example":"v1"}}}}},"id":"schema_103"},"schema_104":{"kind":"json-schema","data":{"type":"object","properties":{"firstName":{"type":["string","null"],"description":"Updated first name","example":"Jane"},"lastName":{"type":["string","null"],"description":"Updated last name","example":"Doe"},"email":{"type":["string","null"],"format":"email","description":"Updated primary email address","example":"jane.doe@firm.com"},"jobTitle":{"type":["string","null"],"description":"Updated job title (free-text)","example":"Manager"},"jobTitleId":{"type":["integer","null"],"format":"int64","description":"Updated job title lookup record ID","example":8},"departmentId":{"type":["integer","null"],"format":"int64","description":"Updated department ID","example":3},"officeId":{"type":["integer","null"],"format":"int64","description":"Updated office ID","example":2},"orgId":{"type":["integer","null"],"format":"int64","description":"Updated organization ID","example":1},"serviceLineId":{"type":["integer","null"],"format":"int64","description":"Updated service line ID","example":4},"staffTypeId":{"type":["integer","null"],"format":"int64","description":"Updated staff type ID (e.g. Partner, Manager, Associate)","example":3},"partnerStaffId":{"type":["integer","null"],"format":"int64","description":"Updated partner staff member ID","example":50},"managerStaffId":{"type":["integer","null"],"format":"int64","description":"Updated manager staff member ID","example":31},"supervisorStaffId":{"type":["integer","null"],"format":"int64","description":"Updated supervisor staff member ID","example":null},"prefix":{"type":["string","null"],"description":"Updated name prefix","example":"Dr."},"startDate":{"type":["string","null"],"format":"date-time","description":"Updated employment start date","example":"2023-06-01T00:00:00"},"endDate":{"type":["string","null"],"format":"date-time","description":"Updated employment end date","example":null},"active":{"type":["boolean","null"],"description":"Updated active status","example":true},"rateCardAssignment":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When provided, replaces the staff member's entire rate card assignment."},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"All current active billing rate and average cost records are deactivated"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and new records are created for the specified rate card. Validated before"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"any writes — invalid "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateTypeId"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" values return HTTP 400."},"children":[],"type":"text"}],"type":"paragraph"}],"required":["rateCardId","billingRates"],"properties":{"rateCardId":{"type":"integer","format":"int64","description":"ID of the rate card to assign","example":6},"billingRates":{"type":"array","description":"New billing rate records to create, one per rate type. Can be an empty array if only the average cost is being updated.\n","items":{"type":"object","required":["rateTypeId"],"properties":{"rateTypeId":{"type":"integer","format":"int64","description":"ID of an existing rate type","example":12},"hourlyBillingRate":{"type":["number","null"],"format":"decimal","description":"Hourly billing rate. Defaults to 0 when omitted.","example":200}}}},"averageCost":{"type":["number","null"],"format":"decimal","description":"New average hourly cost. Omit to leave the average cost unset.","example":95}}}}},"id":"schema_104"},"schema_105":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Staff member identifier","example":312},"pmsRef":{"type":"string","example":"EMP-1042"},"ref":{"type":"string","example":"doe-j"},"firstName":{"type":"string","example":"Jane"},"lastName":{"type":"string","example":"Doe"},"fullName":{"type":["string","null"],"example":"Jane Doe"},"email":{"type":["string","null"],"format":"email","example":"jane.doe@firm.com"},"jobTitle":{"type":["string","null"],"example":"Manager"},"active":{"type":"boolean","example":true},"version":{"type":"integer","format":"int64","description":"Record version. A newly onboarded staff member has version 0; updates through this API do not change it.","example":0},"createdAt":{"type":["string","null"],"format":"date-time","example":"2024-03-15T10:00:00Z"},"updatedAt":{"type":["string","null"],"format":"date-time","example":"2024-06-01T09:00:00Z"},"rateCardAssignment":{"type":["object","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Present only when "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"rateCardAssignment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" was provided in the request. Contains the IDs of the newly created records."},"children":[],"type":"text"}],"type":"paragraph"}],"properties":{"rateCardId":{"type":"integer","format":"int64","example":6},"billingRateIds":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"IDs of the newly created rate_card_staff_billing_rate records"},"children":[],"type":"text"}],"type":"paragraph"}],"items":{"type":"integer","format":"int64"},"example":[205]},"averageCostId":{"type":["integer","null"],"format":"int64","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"ID of the newly created rate_card_staff_average_cost record, or null if averageCost was not provided"},"children":[],"type":"text"}],"type":"paragraph"}],"example":301}}}}},"meta":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Staff member updated successfully"},"timestamp":{"type":"string","format":"date-time","example":"2024-06-01T09:00:00Z"},"version":{"type":"string","example":"v1"}}}}},"id":"schema_105"},"schema_106":{"kind":"json-schema","data":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","properties":{"display":{"type":"string","description":"Display"},"description":{"type":["string","null"],"description":"Description"},"permissionSetId":{"type":["integer","null"],"format":"int64","description":"Permissionsetid"}}},"description":"Items"}}},"id":"schema_106"},"schema_107":{"kind":"json-schema","data":{"type":"object","required":["succeeded","failed"],"properties":{"succeeded":{"type":"array","items":{"type":"object","required":["index","display","id"],"properties":{"index":{"type":"integer","format":"int32","description":"Index"},"display":{"type":"string","description":"Display"},"id":{"type":"integer","format":"int64","description":"Id"}}},"description":"Succeeded"},"failed":{"type":"array","items":{"type":"object","required":["index","display","message"],"properties":{"index":{"type":"integer","format":"int32","description":"Index"},"display":{"type":"string","description":"Display"},"message":{"type":"string","description":"Message"}}},"description":"Failed"}}},"id":"schema_107"},"schema_108":{"kind":"json-schema","data":{"type":"object","required":["pageSize","page","returned","total","records"],"properties":{"pageSize":{"type":"integer","format":"int32","description":"Pagesize"},"page":{"type":"integer","format":"int32","description":"Page"},"returned":{"type":"integer","format":"int32","description":"Returned"},"total":{"type":"integer","format":"int64","description":"Total"},"records":{"type":"array","items":{"type":"object","required":["id","pmsRef","display","active"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"pmsRef":{"type":"string","description":"Pmsref"},"display":{"type":"string","description":"Display"},"description":{"type":["string","null"],"description":"Description"},"active":{"type":"boolean","description":"Active"}}},"description":"Records"}}},"id":"schema_108"},"schema_109":{"kind":"json-schema","data":{"type":"object","required":["departments","total"],"properties":{"departments":{"type":"array","items":{"type":"object","required":["id","pmsRef","name","active","isCreatedByAiwyn","isManagedByAiwyn","createdAt","updatedAt","version","createdByStaffId","lastUpdatedByStaffId","customFieldValues"],"properties":{"id":{"type":"integer"},"pmsRef":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"isCreatedByAiwyn":{"type":"boolean"},"isManagedByAiwyn":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"createdByStaffId":{"type":["integer","null"],"description":"Staff id of whoever created the record."},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff id of whoever last updated the record."},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields."}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_109"},"schema_110":{"kind":"json-schema","data":{"type":"object","required":["offices","total"],"properties":{"offices":{"type":"array","items":{"type":"object","required":["id","pmsRef","name","active","city","stateProvince","country","zip","isCreatedByAiwyn","isManagedByAiwyn","createdAt","updatedAt","version","address","addressLine1","addressLine2","phone","fax","email","timezone","createdByStaffId","lastUpdatedByStaffId","customFieldValues"],"properties":{"id":{"type":"integer"},"pmsRef":{"type":"string"},"name":{"type":["string","null"]},"active":{"type":"boolean"},"city":{"type":["string","null"]},"stateProvince":{"type":["string","null"]},"country":{"type":["string","null"]},"zip":{"type":["string","null"]},"isCreatedByAiwyn":{"type":"boolean"},"isManagedByAiwyn":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"address":{"type":["string","null"],"description":"Full address of the office."},"addressLine1":{"type":["string","null"],"description":"Address line 1."},"addressLine2":{"type":["string","null"],"description":"Address line 2."},"phone":{"type":["string","null"],"description":"Phone number."},"fax":{"type":["string","null"],"description":"Fax number."},"email":{"type":["string","null"],"description":"Email address."},"timezone":{"type":["string","null"],"description":"Time zone of the office."},"createdByStaffId":{"type":["integer","null"],"description":"Staff id of whoever created the record."},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff id of whoever last updated the record."},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields."}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_110"},"schema_111":{"kind":"json-schema","data":{"type":"object","required":["orgs","total"],"properties":{"orgs":{"type":"array","items":{"type":"object","required":["id","pmsRef","name","active","defaultBillingDay","isDefault","isCreatedByAiwyn","isManagedByAiwyn","createdAt","updatedAt","version","createdByStaffId","lastUpdatedByStaffId","customFieldValues"],"properties":{"id":{"type":"integer"},"pmsRef":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"defaultBillingDay":{"type":["integer","null"]},"isDefault":{"type":"boolean"},"isCreatedByAiwyn":{"type":"boolean"},"isManagedByAiwyn":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"createdByStaffId":{"type":["integer","null"],"description":"Staff id of whoever created the record."},"lastUpdatedByStaffId":{"type":["integer","null"],"description":"Staff id of whoever last updated the record."},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields."}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_111"},"schema_112":{"kind":"json-schema","data":{"type":"object","required":["industries","total"],"properties":{"industries":{"type":"array","items":{"type":"object","required":["id","name","active","industryType","ref","sysRefs","createdAt","updatedAt","version","pmsRefs","customFieldValues"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"active":{"type":"boolean"},"industryType":{"type":"string"},"ref":{"type":"string"},"sysRefs":{"type":["object","null"],"additionalProperties":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"pmsRefs":{"type":"string","description":"Identifier in the external practice management system."},"customFieldValues":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields."}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_112"},"schema_113":{"kind":"json-schema","data":{"type":"object","required":["serviceLines","total"],"properties":{"serviceLines":{"type":"array","items":{"type":"object","required":["id","pms_ref","name","active","charge_admin_fee","created_at","updated_at","version","is_created_by_aiwyn","is_managed_by_aiwyn","created_by_staff_id","last_updated_by_staff_id","business_entity_id","custom_field_values"],"properties":{"id":{"type":"integer"},"pms_ref":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"charge_admin_fee":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"version":{"type":"integer"},"is_created_by_aiwyn":{"type":"boolean","description":"Whether the record was created in Aiwyn."},"is_managed_by_aiwyn":{"type":"boolean","description":"Whether Aiwyn manages the record's lifecycle."},"created_by_staff_id":{"type":["integer","null"],"description":"Staff id of whoever created the record."},"last_updated_by_staff_id":{"type":["integer","null"],"description":"Staff id of whoever last updated the record."},"business_entity_id":{"type":["integer","null"],"description":"Business entity id that owns the service line; null when it falls back to the firm default."},"custom_field_values":{"type":["object","null"],"additionalProperties":true,"description":"Firm-defined custom fields."}}}},"total":{"type":"object","required":["aggregate"],"properties":{"aggregate":{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}}}}},"id":"schema_113"},"schema_114":{"kind":"json-schema","data":{"type":"object","required":["records"],"properties":{"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Type"},"systemRef":{"type":"object","description":"Systemref"}}},"description":"Records"}}},"id":"schema_114"},"schema_115":{"kind":"json-schema","data":{"type":"boolean","default":false},"id":"schema_115"},"schema_116":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["entityTypes","total"],"properties":{"entityTypes":{"type":"array","items":{"type":"object","required":["id","name","displayName","isCustom","active","fields","schemaUrl"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"name":{"type":"string","description":"Name"},"displayName":{"type":"string","description":"Displayname"},"description":{"type":["string","null"],"description":"Description"},"isCustom":{"type":"boolean","description":"Iscustom"},"active":{"type":"boolean","description":"Active"},"fields":{"type":"array","items":{"type":"object"},"description":"Fields"},"recordsUrl":{"type":["string","null"],"description":"Recordsurl"},"schemaUrl":{"type":"string","description":"Schemaurl"}}},"description":"Entitytypes"},"total":{"type":"integer","format":"int32","description":"Total"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_116"},"schema_117":{"kind":"json-schema","data":{"type":"object","required":["name","fields"],"properties":{"name":{"type":"string","description":"Name"},"displayName":{"type":["string","null"],"description":"Displayname"},"description":{"type":["string","null"],"description":"Description"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Field name in snake_case: a lowercase letter, then lowercase letters, digits or underscores. A new name in any other form returns 400; names already on the type are kept as they are."},"children":[],"type":"text"}],"type":"paragraph"}]},"displayName":{"type":["string","null"],"description":"Displayname"},"type":{"type":"string","description":"Type"},"required":{"type":"boolean","description":"Required"},"nullable":{"type":"boolean","description":"Nullable"},"description":{"type":["string","null"],"description":"Description"},"referencedEntityType":{"type":["string","null"],"description":"Referencedentitytype"},"rank":{"type":["integer","null"],"format":"int32","description":"Rank"}}},"description":"Fields"}}},"id":"schema_117"},"schema_118":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["id","name","displayName","isCustom","active","fields","schemaUrl"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"name":{"type":"string","description":"Name"},"displayName":{"type":"string","description":"Displayname"},"description":{"type":["string","null"],"description":"Description"},"isCustom":{"type":"boolean","description":"Iscustom"},"active":{"type":"boolean","description":"Active"},"fields":{"type":"array","items":{"type":"object","required":["name","displayName","type","required","nullable","isForeignKey","isCustomField"],"properties":{"name":{"type":"string","description":"Name"},"displayName":{"type":"string","description":"Displayname"},"type":{"type":"string","description":"Type"},"required":{"type":"boolean","description":"Required"},"nullable":{"type":"boolean","description":"Nullable"},"description":{"type":["string","null"],"description":"Description"},"example":{"type":["string","null"],"description":"Example"},"enumValues":{"type":["array","null"],"items":{"type":"string"},"description":"Enumvalues"},"properties":{"type":["array","null"],"items":{"type":"object"},"description":"Properties"},"isForeignKey":{"type":"boolean","description":"Isforeignkey"},"foreignEntityType":{"type":["string","null"],"description":"Foreignentitytype"},"isCustomField":{"type":"boolean","description":"Iscustomfield"}}},"description":"Fields"},"recordsUrl":{"type":["string","null"],"description":"Recordsurl"},"schemaUrl":{"type":"string","description":"Schemaurl"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_118"},"schema_119":{"kind":"json-schema","data":{"type":"object","properties":{"displayName":{"type":["string","null"],"description":"Displayname"},"description":{"type":["string","null"],"description":"Description"},"fields":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Field name in snake_case: a lowercase letter, then lowercase letters, digits or underscores. A new name in any other form returns 400; names already on the type are kept as they are."},"children":[],"type":"text"}],"type":"paragraph"}]},"displayName":{"type":["string","null"],"description":"Displayname"},"type":{"type":"string","description":"Type"},"required":{"type":"boolean","description":"Required"},"nullable":{"type":"boolean","description":"Nullable"},"description":{"type":["string","null"],"description":"Description"},"referencedEntityType":{"type":["string","null"],"description":"Referencedentitytype"},"rank":{"type":["integer","null"],"format":"int32","description":"Rank"}}},"description":"Fields"},"active":{"type":["boolean","null"],"description":"Active"}}},"id":"schema_119"},"schema_120":{"kind":"json-schema","data":{"type":"array","items":{"type":"integer","format":"int64"}},"id":"schema_120"},"schema_121":{"kind":"json-schema","data":{"type":"integer","format":"int32","default":20},"id":"schema_121"},"schema_122":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["items","hasMore"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","active","createdAt","path","context"],"properties":{"id":{"type":"string","description":"Id"},"name":{"type":"string","description":"Name"},"active":{"type":"boolean","description":"Whether the file is active. This list returns active files only."},"createdAt":{"type":"string","description":"Createdat"},"updatedAt":{"type":["string","null"],"description":"When the file was last updated (ISO-8601)."},"sizeBytes":{"type":["integer","null"],"format":"int64","description":"Sizebytes"},"path":{"type":"string","description":"Path"},"downloadUrl":{"type":["string","null"],"description":"Downloadurl"},"downloadUrlExpiresAt":{"type":["string","null"],"description":"Downloadurlexpiresat"},"context":{"type":"object","description":"Context"}}},"description":"Items"},"nextCursor":{"type":["string","null"],"description":"Nextcursor"},"hasMore":{"type":"boolean","description":"Hasmore"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_122"},"schema_123":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["id","filename","fileSource","active"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"filename":{"type":"string","description":"Filename"},"fileSource":{"type":"string","description":"Filesource"},"fileStatus":{"type":["string","null"],"description":"Filestatus"},"active":{"type":"boolean","description":"Active"},"createdAt":{"type":["string","null"],"format":"date-time","description":"Createdat"},"updatedAt":{"type":["string","null"],"format":"date-time","description":"Updatedat"},"externalDmsFileId":{"type":["string","null"],"description":"Externaldmsfileid"},"fileInfo":{"type":["object","null"],"description":"Fileinfo"},"downloadUrl":{"type":["string","null"],"description":"Downloadurl"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_123"},"schema_124":{"kind":"json-schema","data":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","entity","operation","enabled"],"properties":{"id":{"type":["integer","null"],"format":"int64"},"entity":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Value to send as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entityType"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when creating a subscription."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"RequestItem"},"operation":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Value to send as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when creating a subscription."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"SENT"},"enabled":{"type":"boolean","description":"Only enabled entries can be subscribed to."}}}},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_124"},"schema_125":{"kind":"json-schema","data":{"type":"object","required":["entityType","operation","deliveryUrl"],"properties":{"entityType":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entity of the event, as the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entity"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value of an enabled catalog entry"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/event-subscriptions/catalog"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"RequestItem"},"operation":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operation of the event, as the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value of the same catalog entry."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"SENT","enum":["CREATED","UPDATED","DELETED","SIGNED","EXECUTED","CANCELLED","FAILED","POSTED","APPROVED","REJECTED","COMPLETED","SENT","VIEWED","NOTIFIED","MARK_FINISHED","UNDO","MARK_NA","FILE_UPLOADED","FILE_DELETED","FILE_REPLACED","FILE_FLAGGED","FILE_ATTACHED","FILE_REMOVED","COMMENT_ADDED","DUE_DATE_ADDED","DUE_DATE_CHANGED","ASSIGNEE_ADDED","ASSIGNEE_REMOVED","REVIEWER_ADDED","REVIEWER_REMOVED","REVIEWER_CHANGED","RESTRICTED","REQUEST_REASSIGNED","CONSENT_RECORDED"]},"deliveryUrl":{"type":"string","description":"Deliveryurl"},"filterExpression":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Narrows what this subscription receives. Supported values: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ownPaymentLinksOnly"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (only"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"payments made through quick payment links minted by the API user that owns this"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"subscription; links minted through the SafeSend application-key route have no minting"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"user and never match), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"paymentLinkOnly"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (payments made through any quick payment link of the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"firm) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"allPayments"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (every payment of the firm). The last two are accepted only while"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the API user holds the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PYMT_EVNT_ALL"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Product API role, and stop delivering if the firm"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"revokes it. Any other value is rejected with 400. Required for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" subscriptions;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"optional for other entity types, where omitting it means every event of the entity and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"ownPaymentLinksOnly"},"description":{"type":["string","null"],"description":"Description"}}},"id":"schema_125"},"schema_126":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","properties":{"subscription":{"type":"object","description":"Subscription"},"webhookSecret":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The caller's webhook signing secret. It is the same secret for every subscription of the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"caller and can be read again with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/event-subscriptions/webhook/secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"webhookSecretInstructions":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Fixed advisory text. It says the secret \"will not be shown again\"; the secret is in fact"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"also returned by "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/event-subscriptions/webhook/secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_126"},"schema_127":{"kind":"json-schema","data":{"type":"integer","format":"int32","default":0},"id":"schema_127"},"schema_128":{"kind":"json-schema","data":{"type":"integer","format":"int32","default":50},"id":"schema_128"},"schema_129":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["content","totalElements","totalPages","currentPage","hasNext","hasPrevious"],"properties":{"content":{"type":"array","items":{"type":"object","required":["id","entityType","operation","deliveryUrl","active","status","isInternal","eventEnabled"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"staffId":{"type":["integer","null"],"format":"int64","description":"Staffid"},"entityType":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entity of the event as a string, the catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entity"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value (e.g. RequestItem)."},"children":[],"type":"text"}],"type":"paragraph"}]},"operation":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operation of the event as a string, the catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value (e.g. SENT)."},"children":[],"type":"text"}],"type":"paragraph"}]},"deliveryUrl":{"type":"string","description":"Deliveryurl"},"description":{"type":["string","null"],"description":"Description"},"filterExpression":{"type":["string","null"],"description":"Filterexpression"},"active":{"type":"boolean","description":"Whether the subscription receives deliveries; false after deactivation."},"status":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Not changed by deactivation, so a deactivated subscription still reports ACTIVE; use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" instead."},"children":[],"type":"text"}],"type":"paragraph"}]},"createdAt":{"type":["number","null"],"description":"When it was created, as Unix epoch seconds with a fractional part"},"updatedAt":{"type":["number","null"],"description":"When it was last updated, as Unix epoch seconds with a fractional part"},"isInternal":{"type":"boolean","description":"Isinternal"},"productApiSystemUserId":{"type":["integer","null"],"format":"int64","description":"Productapisystemuserid"},"eventEnabled":{"type":"boolean","description":"False when an admin has disabled the event; the subscription is kept but receives no deliveries."}}},"description":"Content"},"totalElements":{"type":"integer","format":"int64","description":"Totalelements"},"totalPages":{"type":"integer","format":"int32","description":"Totalpages"},"currentPage":{"type":"integer","format":"int32","description":"Currentpage"},"hasNext":{"type":"boolean","description":"Hasnext"},"hasPrevious":{"type":"boolean","description":"Hasprevious"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_129"},"schema_130":{"kind":"json-schema","data":{"type":"object","properties":{"entityType":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entity of the event, as the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entity"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value of a catalog entry ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"GET /api/v1/event-subscriptions/catalog"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"RequestItem"},"operation":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operation of the event, as the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value of a catalog entry."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"SENT","enum":["CREATED","UPDATED","DELETED","SIGNED","EXECUTED","CANCELLED","FAILED","POSTED","APPROVED","REJECTED","COMPLETED","SENT","VIEWED","NOTIFIED","MARK_FINISHED","UNDO","MARK_NA","FILE_UPLOADED","FILE_DELETED","FILE_REPLACED","FILE_FLAGGED","FILE_ATTACHED","FILE_REMOVED","COMMENT_ADDED","DUE_DATE_ADDED","DUE_DATE_CHANGED","ASSIGNEE_ADDED","ASSIGNEE_REMOVED","REVIEWER_ADDED","REVIEWER_REMOVED","REVIEWER_CHANGED","RESTRICTED","REQUEST_REASSIGNED","CONSENT_RECORDED",null]},"deliveryUrl":{"type":["string","null"],"description":"Deliveryurl"},"filterExpression":{"type":["string","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Narrows what this subscription receives. Supported values: "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ownPaymentLinksOnly"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (only"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"payments made through quick payment links minted by the API user that owns this"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"subscription; links minted through the SafeSend application-key route have no minting"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"user and never match), "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"paymentLinkOnly"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (payments made through any quick payment link of the"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"firm) and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"allPayments"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" (every payment of the firm). The last two are accepted only while"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"the API user holds the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"PYMT_EVNT_ALL"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" Product API role, and stop delivering if the firm"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"revokes it. Any other value is rejected with 400. Required for "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Payment"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" subscriptions;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"optional for other entity types, where omitting it means every event of the entity and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"ownPaymentLinksOnly"},"description":{"type":["string","null"],"description":"Description"},"active":{"type":["boolean","null"],"description":"Active"}}},"id":"schema_130"},"schema_131":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["id","staffId","entityType","operation","deliveryUrl","description","filterExpression","active","status","createdAt","updatedAt","isInternal"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"staffId":{"type":["integer","null"],"format":"int64","description":"Staffid"},"entityType":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entity of the event (the catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entity"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value)."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"RequestItem"},"operation":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operation of the event (the catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value)."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"SENT","enum":["CREATED","UPDATED","DELETED","SIGNED","EXECUTED","CANCELLED","FAILED","POSTED","APPROVED","REJECTED","COMPLETED","SENT","VIEWED","NOTIFIED","MARK_FINISHED","UNDO","MARK_NA","FILE_UPLOADED","FILE_DELETED","FILE_REPLACED","FILE_FLAGGED","FILE_ATTACHED","FILE_REMOVED","COMMENT_ADDED","DUE_DATE_ADDED","DUE_DATE_CHANGED","ASSIGNEE_ADDED","ASSIGNEE_REMOVED","REVIEWER_ADDED","REVIEWER_REMOVED","REVIEWER_CHANGED","RESTRICTED","REQUEST_REASSIGNED","CONSENT_RECORDED"]},"deliveryUrl":{"type":"string","description":"Deliveryurl"},"description":{"type":["string","null"],"description":"Description"},"filterExpression":{"type":["string","null"],"description":"Filterexpression"},"active":{"type":"boolean","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Whether the subscription receives deliveries. "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"false"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" after "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"DELETE /api/v1/event-subscriptions/{id}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"}]},"status":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Lifecycle status. Deactivating a subscription does not change it: a deactivated"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"subscription still reports "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ACTIVE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" to tell whether it receives deliveries."},"children":[],"type":"text"}],"type":"paragraph"}],"example":"ACTIVE"},"createdAt":{"type":["number","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When the subscription was created, as Unix epoch seconds with a fractional part (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"1793322409.066411"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"paragraph"}],"example":1793322409.066411},"updatedAt":{"type":["number","null"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"When the subscription was last updated, as Unix epoch seconds with a fractional part (for example "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"1793322409.066411"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":")"},"children":[],"type":"text"}],"type":"paragraph"}],"example":1793322409.066411},"isInternal":{"type":"boolean","description":"Isinternal"},"productApiSystemUserId":{"type":["integer","null"],"format":"int64","description":"Product API system user that owns the subscription, when it is not owned by a staff member."},"eventEnabled":{"type":"boolean","description":"False when an admin has disabled the event; the subscription is kept but receives no deliveries."}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_131"},"schema_132":{"kind":"json-schema","data":{"type":"object","required":["error","meta"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"ERROR"},"message":{"type":"string","example":"Subscription not found with id: 999999999"},"details":{}}},"meta":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":["string","null"]},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_132"},"schema_133":{"kind":"json-schema","data":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","description":"Always an empty object."},"meta":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Event subscription deactivated successfully"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_133"},"schema_134":{"kind":"json-schema","data":{"type":"object","required":["error","meta"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"ERROR"},"message":{"type":"string","example":"Subscription with id 999999999 not found or already inactive"}}},"meta":{"type":"object","properties":{"success":{"type":"boolean","example":false},"timestamp":{"type":"string","format":"date-time"}}}}},"id":"schema_134"},"schema_135":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["id","entityType","operation","deliveryUrl","active","status","isInternal","eventEnabled"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"staffId":{"type":["integer","null"],"format":"int64","description":"Staffid"},"entityType":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Entity of the event as a string, the catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"entity"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value (e.g. RequestItem)."},"children":[],"type":"text"}],"type":"paragraph"}]},"operation":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Operation of the event as a string, the catalog "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"operation"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" value (e.g. SENT)."},"children":[],"type":"text"}],"type":"paragraph"}]},"deliveryUrl":{"type":"string","description":"Deliveryurl"},"description":{"type":["string","null"],"description":"Description"},"filterExpression":{"type":["string","null"],"description":"Filterexpression"},"active":{"type":"boolean","description":"Whether the subscription receives deliveries; false after deactivation."},"status":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Not changed by deactivation, so a deactivated subscription still reports ACTIVE; use "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"active"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" instead."},"children":[],"type":"text"}],"type":"paragraph"}]},"createdAt":{"type":["number","null"],"description":"When it was created, as Unix epoch seconds with a fractional part"},"updatedAt":{"type":["number","null"],"description":"When it was last updated, as Unix epoch seconds with a fractional part"},"isInternal":{"type":"boolean","description":"Isinternal"},"productApiSystemUserId":{"type":["integer","null"],"format":"int64","description":"Productapisystemuserid"},"eventEnabled":{"type":"boolean","description":"False when an admin has disabled the event; the subscription is kept but receives no deliveries."}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_135"},"schema_136":{"kind":"json-schema","data":{"type":"integer","format":"int32"},"id":"schema_136"},"schema_137":{"kind":"json-schema","data":{"type":"string","format":"date-time"},"id":"schema_137"},"schema_138":{"kind":"json-schema","data":{"type":"object","properties":{"data":{"type":"object","required":["content","totalElements","totalPages","currentPage","hasNext","hasPrevious"],"properties":{"content":{"type":"array","items":{"type":"object","required":["id","eventId","attemptNumber","timestamp","deliveryUrl","success"],"properties":{"id":{"type":"integer","format":"int64","description":"Id"},"eventId":{"type":"integer","format":"int64","description":"Eventid"},"attemptNumber":{"type":"integer","format":"int32","description":"Attemptnumber"},"timestamp":{"type":"number","description":"When the attempt was made, as Unix epoch seconds with a fractional part."},"statusCode":{"type":["integer","null"],"format":"int32","description":"Statuscode"},"responseBody":{"type":["string","null"],"description":"Responsebody"},"errorMessage":{"type":["string","null"],"description":"Errormessage"},"deliveryUrl":{"type":"string","description":"Deliveryurl"},"deliveryTimeMs":{"type":["integer","null"],"format":"int64","description":"Deliverytimems"},"success":{"type":"boolean","description":"Success"},"createdAt":{"type":["number","null"],"description":"When the attempt was recorded, as Unix epoch seconds with a fractional part."}}},"description":"Content"},"totalElements":{"type":"integer","format":"int64","description":"Totalelements"},"totalPages":{"type":"integer","format":"int32","description":"Totalpages"},"currentPage":{"type":"integer","format":"int32","description":"Currentpage"},"hasNext":{"type":"boolean","description":"Hasnext"},"hasPrevious":{"type":"boolean","description":"Hasprevious"}}},"error":{"type":["object","null"]},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_138"},"schema_139":{"kind":"json-schema","data":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"string","description":"The webhook signing secret."},"meta":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string","example":"Webhook secret retrieved successfully"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}},"id":"schema_139"},"schema_140":{"kind":"json-schema","data":{"type":"object","required":["payload","secret"],"properties":{"payload":{"description":"Any JSON value to sign.","example":{"test":true}},"secret":{"type":"string","description":"Secret to sign the payload with."}}},"id":"schema_140"},"schema_141":{"kind":"json-schema","data":{"type":"object","required":["payload","signature","secret"],"properties":{"payload":{"description":"The payload from the request."},"signature":{"type":"string","example":"sha256=Epvu8EP9JvCXSg+nVg9aTomZkJ7u3vESqWQjFs1WmkA="},"secret":{"type":"string","description":"The secret from the request."}}},"id":"schema_141"},"schema_142":{"kind":"json-schema","data":{"type":"object","required":["payload","signature","secret"],"properties":{"payload":{"description":"The JSON value that was signed.","example":{"test":true}},"signature":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Signature to check, "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"sha256="},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" followed by the Base64 HMAC-SHA256."},"children":[],"type":"text"}],"type":"paragraph"}]},"secret":{"type":"string","description":"Secret the payload was signed with."}}},"id":"schema_142"},"schema_143":{"kind":"json-schema","data":{"type":"object","required":["isValid","payload","signature","secret"],"properties":{"isValid":{"type":"boolean"},"payload":{"description":"The payload from the request."},"signature":{"type":"string","description":"The signature from the request."},"secret":{"type":"string","description":"The secret from the request."}}},"id":"schema_143"},"schema_144":{"kind":"json-schema","data":{"type":"string","format":"uuid"},"id":"schema_144"}},"exampleStore":{"paths/~1v1~1auth~1token/post/responses/401/content/application~1json/example":{"value":{"error":"UnauthorizedException","message":"Authentication failed","code":"UNAUTHORIZED"},"id":"paths/~1v1~1auth~1token/post/responses/401/content/application~1json/example"},"paths/~1v1~1auth~1token/post/responses/429/content/application~1json/example":{"value":{"error":"RateLimitExceeded","message":"Too many tokens issued for this API user; retry after the Retry-After delay","code":"TOO_MANY_REQUESTS"},"id":"paths/~1v1~1auth~1token/post/responses/429/content/application~1json/example"},"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/first_page":{"value":{"pageSize":1000,"page":0},"key":"first_page","summary":"First 1,000 clients (skip 0)","id":"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/first_page"},"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/next_chunk":{"value":{"pageSize":1000,"page":1000},"key":"next_chunk","summary":"Next 1,000 clients after the first 1,000","id":"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/next_chunk"},"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/last_partial_chunk":{"value":{"pageSize":1000,"page":25000},"key":"last_partial_chunk","summary":"Remaining clients after skipping 25,000","id":"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/last_partial_chunk"},"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/beyond_last_record":{"value":{"pageSize":1000,"page":25156},"key":"beyond_last_record","summary":"Offset at or beyond the total count (empty result)","id":"paths/~1gql~1v1~1clients/post/requestBody/content/application~1json/examples/beyond_last_record"},"paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/successful_response":{"value":{"clients":[{"id":122,"pmsRef":"1155","clientRef":"41664","name":"Acme Bread Co.","active":true,"ebilling":true,"emailStatement":true,"chargeAdminFee":false,"clientContactInfoId":9957,"excludeFromCollections":false,"default_billing_day":null,"prefContactId":601,"billingContactId":null,"billingClientId":null,"departmentId":3,"officeId":1,"industryId":null,"clientGroupId":null,"partnerStaffId":53,"managerStaffId":null,"staffBillingManagerId":null,"clientTypeId":7,"clientBusinessEntityId":null,"fiscalYearEndMonth":12,"fiscalYearEndDay":31,"createdAt":"2023-05-12T22:43:55.488054+00:00","updatedAt":"2023-06-09T21:34:28.817274+00:00","customFieldValues":{"industry_niche":"Manufacturing","naics_code":"333120"},"orgId":null,"clientKey":null,"updateByStaffId":53,"exclusionStatusUpdatedAt":"2023-05-12T22:43:55.488054+00:00","isManagedByAiwyn":false,"isCreatedByAiwyn":false,"originatingPartnerStaffId":null,"billingNotes":null,"description":null,"notes":null,"noticePeriod":null,"secondaryContactId":null,"fein":null,"status":"ACTIVE","invoiceDeliveryMethod":"EMAIL","mergedInto":null,"inactivateMergedRecord":false,"department":{"id":3,"pmsRef":"TAX","name":"Tax"},"office":{"id":1,"pmsRef":"OFF-1","name":"Charlotte","city":"Charlotte","stateProvince":"NC","country":"US"},"industry":null,"clientType":{"id":7,"name":"Business","pmsRef":"BUS"},"clientBusinessEntity":null,"entityType":null,"partnerStaff":{"id":53,"firstName":"Michael","lastName":"Chen","email":"m.chen@company.com"},"managerStaff":null,"billManager":null,"relationshipOwner":{"id":53,"firstName":"Michael","lastName":"Chen","email":"m.chen@company.com"}}],"total":{"aggregate":{"count":13697}}},"key":"successful_response","summary":"Typical response with client data","id":"paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/empty_response":{"value":{"clients":[],"total":{"aggregate":{"count":25156}}},"key":"empty_response","summary":"Empty result set (no clients, or offset at/beyond total)","id":"paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/no_clients":{"value":{"clients":[],"total":{"aggregate":{"count":0}}},"key":"no_clients","summary":"Empty tenant (zero clients)","id":"paths/~1gql~1v1~1clients/post/responses/200/content/application~1json/examples/no_clients"},"paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/invalid_page_size":{"value":{"error":"pageSize must be an integer from 1 to 1000"},"key":"invalid_page_size","summary":"Invalid pageSize parameter","id":"paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/invalid_page_size"},"paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/negative_page":{"value":{"error":"page must be an integer of 0 or more"},"key":"negative_page","summary":"Negative page","id":"paths/~1gql~1v1~1clients/post/responses/400/content/application~1json/examples/negative_page"},"paths/~1gql~1v1~1clients/post/responses/401/content/application~1json/examples/missing_token":{"value":{"error":"missing Authorization header"},"key":"missing_token","summary":"No Authorization header","id":"paths/~1gql~1v1~1clients/post/responses/401/content/application~1json/examples/missing_token"},"paths/~1gql~1v1~1clients~1search/post/requestBody/content/application~1json/examples/default_search":{"value":{"pageSize":1,"page":0,"where":{"_and":[{"_or":[{"name":{"_ilike":"%tech%"}},{"clientRef":{"_ilike":"%45%"}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"partnerStaffId":{"_in":[5,6,7,8]}}]},"orderBy":[{"name":"asc"},{"createdAt":"desc"}]},"key":"default_search","summary":"Default search with filtering","id":"paths/~1gql~1v1~1clients~1search/post/requestBody/content/application~1json/examples/default_search"},"paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/successful_response":{"value":{"clients":[{"id":122,"pmsRef":"1155","clientRef":"41664","name":"Acme Bread Co.","active":true,"ebilling":true,"emailStatement":true,"chargeAdminFee":false,"clientContactInfoId":9957,"excludeFromCollections":false,"default_billing_day":null,"prefContactId":601,"billingContactId":null,"billingClientId":null,"departmentId":3,"officeId":1,"industryId":null,"clientGroupId":null,"partnerStaffId":53,"managerStaffId":null,"staffBillingManagerId":null,"clientTypeId":7,"clientBusinessEntityId":null,"fiscalYearEndMonth":12,"fiscalYearEndDay":31,"createdAt":"2023-05-12T22:43:55.488054+00:00","updatedAt":"2023-06-09T21:34:28.817274+00:00","customFieldValues":{"industry_niche":"Manufacturing","naics_code":"333120"},"orgId":null,"clientKey":null,"updateByStaffId":53,"exclusionStatusUpdatedAt":"2023-05-12T22:43:55.488054+00:00","isManagedByAiwyn":false,"isCreatedByAiwyn":false,"originatingPartnerStaffId":null,"billingNotes":null,"description":null,"notes":null,"noticePeriod":null,"secondaryContactId":null,"fein":null,"status":"ACTIVE","invoiceDeliveryMethod":"EMAIL","mergedInto":null,"inactivateMergedRecord":false,"department":{"id":3,"pmsRef":"TAX","name":"Tax"},"office":{"id":1,"pmsRef":"OFF-1","name":"Charlotte","city":"Charlotte","stateProvince":"NC","country":"US"},"industry":null,"clientType":{"id":7,"name":"Business","pmsRef":"BUS"},"clientBusinessEntity":null,"entityType":null,"partnerStaff":{"id":53,"firstName":"Michael","lastName":"Chen","email":"m.chen@company.com"},"managerStaff":null,"billManager":null,"relationshipOwner":{"id":53,"firstName":"Michael","lastName":"Chen","email":"m.chen@company.com"}}],"total":{"aggregate":{"count":59}}},"key":"successful_response","summary":"Filtered clients with dynamic ordering and relationships","id":"paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/empty_response":{"value":{"clients":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"No clients match filter criteria","id":"paths/~1gql~1v1~1clients~1search/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_where_clause":{"value":{"error":"Invalid where clause structure: missing operator in condition","code":"INVALID_WHERE_CLAUSE"},"key":"invalid_where_clause","summary":"Malformed where clause","id":"paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_where_clause"},"paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_order_by":{"value":{"error":"Invalid orderBy field or direction specified","code":"INVALID_ORDER_BY"},"key":"invalid_order_by","summary":"Invalid ordering specification","id":"paths/~1gql~1v1~1clients~1search/post/responses/400/content/application~1json/examples/invalid_order_by"},"paths/~1gql~1v1~1clients~1search/post/responses/401/content/application~1json/examples/missing_auth":{"value":{"error":"Missing or invalid authentication token","code":"UNAUTHORIZED"},"key":"missing_auth","summary":"Missing authentication token","id":"paths/~1gql~1v1~1clients~1search/post/responses/401/content/application~1json/examples/missing_auth"},"paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/found":{"value":{"client":{"id":122,"pmsRef":"1155","clientRef":"41664","name":"Acme Bread Co.","active":true,"ebilling":true,"emailStatement":true,"chargeAdminFee":false,"clientContactInfoId":9957,"excludeFromCollections":false,"default_billing_day":null,"prefContactId":601,"billingContactId":null,"billingClientId":null,"departmentId":3,"officeId":1,"industryId":null,"clientGroupId":null,"partnerStaffId":53,"managerStaffId":null,"staffBillingManagerId":null,"clientTypeId":7,"clientBusinessEntityId":null,"fiscalYearEndMonth":12,"fiscalYearEndDay":31,"createdAt":"2023-05-12T22:43:55.488054+00:00","updatedAt":"2023-06-09T21:34:28.817274+00:00","customFieldValues":{"industry_niche":"Manufacturing","naics_code":"333120"},"orgId":null,"clientKey":null,"updateByStaffId":53,"exclusionStatusUpdatedAt":"2023-05-12T22:43:55.488054+00:00","isManagedByAiwyn":false,"isCreatedByAiwyn":false,"originatingPartnerStaffId":null,"billingNotes":null,"description":null,"notes":null,"noticePeriod":null,"secondaryContactId":null,"fein":null,"status":"ACTIVE","invoiceDeliveryMethod":"EMAIL","mergedInto":null,"inactivateMergedRecord":false,"department":{"id":3,"pmsRef":"TAX","name":"Tax"},"office":{"id":1,"pmsRef":"OFF-1","name":"Charlotte","city":"Charlotte","stateProvince":"NC","country":"US"},"industry":null,"clientType":{"id":7,"name":"Business","pmsRef":"BUS"},"clientBusinessEntity":null,"entityType":null,"partnerStaff":{"id":53,"firstName":"Michael","lastName":"Chen","email":"m.chen@company.com"},"managerStaff":null,"billManager":null,"relationshipOwner":{"id":53,"firstName":"Michael","lastName":"Chen","email":"m.chen@company.com"},"clientContactInfo":{"id":9957,"firstName":"Sarah","lastName":"Johnson","email":"sarah.johnson@acme.com","phone":"555-0123"}}},"key":"found","summary":"Client found","id":"paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/found"},"paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"client":null},"key":"not_found","summary":"No client with this id","id":"paths/~1gql~1v1~1client~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1client~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id":{"value":{"code":"data-exception","error":"invalid input syntax for type integer: \"abc\"","path":"$"},"key":"non_numeric_id","summary":"Non-numeric id","id":"paths/~1gql~1v1~1client~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"},"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/new_contact_inline":{"value":{"name":"Acme Corporation","pmsRef":"ACME-001","clientRef":"ACME-001","officeId":1,"prefContact":{"pmsRef":"CONT-001","contactInfo":{"pmsRef":"CONT-001","firstName":"Jane","lastName":"Smith","email":"jane.smith@acme.com"}},"address":{"address":"123 Main St","address2":"Suite 400","city":"Charlotte","state":"NC","country":"US","zipCode":"28202"}},"key":"new_contact_inline","summary":"New client with inline preferred contact and client address","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/new_contact_inline"},"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/existing_contact":{"value":{"name":"Beta Industries","pmsRef":"BETA-002","clientRef":"BETA-002","officeId":1,"prefContact":{"id":501},"billingContact":{"id":502}},"key":"existing_contact","summary":"New client linking to existing contacts","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/existing_contact"},"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/minimal":{"value":{"name":"Gamma LLC","pmsRef":"GAMMA-003","clientRef":"GAMMA-003","officeId":1},"key":"minimal","summary":"Minimal required fields only","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/minimal"},"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/crm_integration_fields":{"value":{"name":"Redw Client","pmsRef":"REDW-100","clientRef":"REDW-100","officeId":1,"clientTypeId":7,"clientBusinessEntityId":4,"staffBillingManagerId":22,"fiscalYearEndMonth":12,"fiscalYearEndDay":31,"customFieldValuesJson":"{\"industry_niche\":\"Manufacturing\",\"naics_code\":\"333120\"}","taxRegionIds":[3,7]},"key":"crm_integration_fields","summary":"Client with classification, fiscal year end, custom fields, and tax regions","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/crm_integration_fields"},"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/with_addresses":{"value":{"name":"Delta Partners","pmsRef":"DELTA-004","clientRef":"DELTA-004","officeId":1,"address":{"address":"123 Main St","address2":"Suite 400","city":"Charlotte","state":"North Carolina","country":"us","zipCode":"28202"},"billingAddress":{"pmsRef":"DELTA-004-BILLING","address":"PO Box 999","city":"Raleigh","state":"NC","country":"US","zipCode":"27601"}},"key":"with_addresses","summary":"Client with its own address and a separate billing address","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/requestBody/content/application~1json/examples/with_addresses"},"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success":{"value":{"data":{"client":{"id":1001,"pmsRef":"ACME-001","clientRef":"ACME-001","name":"Acme Corporation","officeId":1,"active":true,"status":"ACTIVE","version":1,"createdAt":"2024-03-15T10:00:00Z","updatedAt":"2024-03-15T10:00:00Z"},"prefContactId":601,"billingContactId":null,"secondaryContactId":null,"clientContactInfoId":44489,"billingAddressId":null,"taxRegionIds":[],"ignoredCustomFields":[]},"meta":{"success":true,"message":"Client onboarded successfully","timestamp":"2024-03-15T10:00:00.123Z","version":"v1"}},"key":"success","summary":"Client onboarded with a new preferred contact and client address","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success"},"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_addresses":{"value":{"data":{"client":{"id":1003,"pmsRef":"DELTA-004","clientRef":"DELTA-004","name":"Delta Partners","officeId":1,"active":true,"status":"ACTIVE","version":1,"createdAt":"2024-03-15T10:00:00Z","updatedAt":"2024-03-15T10:00:00Z"},"prefContactId":null,"billingContactId":null,"secondaryContactId":null,"clientContactInfoId":44489,"billingAddressId":211,"taxRegionIds":[],"ignoredCustomFields":[]},"meta":{"success":true,"message":"Client onboarded successfully","timestamp":"2024-03-15T10:00:00.123Z","version":"v1"}},"key":"success_with_addresses","summary":"Onboarded with a client address and a billing address","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_addresses"},"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_ignored_custom_fields":{"value":{"data":{"client":{"id":1002,"pmsRef":"REDW-100","clientRef":"REDW-100","name":"Redw Client","officeId":1,"clientTypeId":7,"clientBusinessEntityId":4,"staffBillingManagerId":22,"fiscalYearEndMonth":12,"fiscalYearEndDay":31,"customFieldValuesJson":"{\"industry_niche\":\"Manufacturing\"}","active":true,"status":"ACTIVE","version":1,"createdAt":"2024-03-15T10:00:00Z","updatedAt":"2024-03-15T10:00:00Z"},"prefContactId":null,"billingContactId":null,"secondaryContactId":null,"clientContactInfoId":null,"billingAddressId":null,"taxRegionIds":[3,7],"ignoredCustomFields":["naics_cod"]},"meta":{"success":true,"message":"Client onboarded successfully; ignored unknown or protected custom fields: naics_cod","timestamp":"2024-03-15T10:00:00.123Z","version":"v1"}},"key":"success_with_ignored_custom_fields","summary":"Onboarded with tax regions; an unknown custom field key was dropped","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/201/content/application~1json/examples/success_with_ignored_custom_fields"},"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/400/content/application~1json/examples/duplicate_client_pms_ref":{"value":{"error":{"code":"ERROR","message":"Invalid onboarding data: A client with the provided PMS reference already exists"},"meta":{"success":false,"timestamp":"2024-03-15T10:00:00.123Z"}},"key":"duplicate_client_pms_ref","summary":"A client with this pmsRef already exists","id":"paths/~1api~1v1~1clients~1v1~1onboard/post/responses/400/content/application~1json/examples/duplicate_client_pms_ref"},"paths/~1gql~1v1~1client_types/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1client_types/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1client_types/post/responses/200/content/application~1json/examples/sample":{"value":{"clientTypes":[{"id":2,"name":"Corporation","active":true,"is_business":true,"pms_ref":"CORP","created_at":"2025-01-02T03:04:05Z","updated_at":"2025-01-02T03:04:05Z","created_by_staff_id":12,"last_updated_by_staff_id":null}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1client_types/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1tax_regions/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1tax_regions/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1tax_regions/post/responses/200/content/application~1json/examples/sample":{"value":{"taxRegions":[{"id":10,"name":"California","active":true,"description":"California state sales tax","tax_percentage":7.25,"type":"STATE","created_at":"2025-01-02T03:04:05Z","updated_at":"2025-01-02T03:04:05Z","created_by_staff_id":12,"last_updated_by_staff_id":null,"pms_ref":"CA"}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1tax_regions/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1client_groups/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1client_groups/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/successful_response":{"value":{"clientGroups":[{"id":10,"name":"Acme Corp Group","pmsRef":"GRP-001","active":true,"isManagedByAiwyn":false,"parentClientId":null,"primaryContactId":201,"billingContactId":202,"partnerStaffId":101,"managerStaffId":102,"officeId":5,"createdAt":"2024-01-15T10:00:00.000000+00:00","updatedAt":"2024-06-20T14:30:00.000000+00:00","version":3,"customFieldValues":{"region":"West"},"partnerStaff":{"id":101,"firstName":"Michael","lastName":"Chen","email":"m.chen@company.com"},"managerStaff":{"id":102,"firstName":"Lisa","lastName":"Rodriguez","email":"l.rodriguez@company.com"},"office":{"id":5,"pmsRef":"OFF-5","name":"San Francisco"}},{"id":11,"name":"Beta Industries Group","pmsRef":"GRP-002","active":true,"isManagedByAiwyn":true,"parentClientId":null,"primaryContactId":null,"billingContactId":null,"partnerStaffId":103,"managerStaffId":null,"officeId":null,"createdAt":"2024-02-10T08:00:00.000000+00:00","updatedAt":"2024-02-10T08:00:00.000000+00:00","version":1,"customFieldValues":null,"partnerStaff":{"id":103,"firstName":"Jennifer","lastName":"Park","email":"j.park@company.com"},"managerStaff":null,"office":null}],"total":{"aggregate":{"count":142}}},"key":"successful_response","summary":"Typical response with client group data","id":"paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/empty_response":{"value":{"clientGroups":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"Empty result set","id":"paths/~1gql~1v1~1client_groups/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1client_business_entities/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1client_business_entities/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1client_business_entities/post/responses/200/content/application~1json/examples/sample":{"value":{"clientBusinessEntities":[{"id":101,"name":"Tax","active":true,"clientBusinessEntityType":"TAX","ref":"TAX","sysRefs":{},"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-02T03:04:05Z","version":1,"pmsRefs":"TAX","customFieldValues":null}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1client_business_entities/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1contacts/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1contacts/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/successful_response":{"value":{"contacts":[{"id":1001,"pms_ref":"C-4451","active":true,"contact_info_id":7001,"office_id":3,"staff_id":null,"type":null,"fwd_email_confirmation":false,"inactivated_at":null,"created_at":"2024-03-01T15:20:11.104223+00:00","updated_at":"2024-09-14T08:02:47.551092+00:00","is_managed_by_aiwyn":false,"is_created_by_aiwyn":false,"username":null,"custom_field_values":null,"contact_info":{"id":7001,"pms_ref":"C-4451","salutation":null,"firstName":"Jane","lastName":"Smith","email":"jane.smith@acme.com","phone":null,"address":"123 Main St","address2":null,"city":"Charlotte","state":"NC","country":"US","zip_code":"28202","active":true},"contact_clients":[{"client_id":122,"contact_id":1001,"pms_ref":"LL-9981","active":true}]}],"total":{"aggregate":{"count":959}}},"key":"successful_response","summary":"One page of contacts","id":"paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/empty_response":{"value":{"contacts":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"No contacts (or offset at/beyond the total)","id":"paths/~1gql~1v1~1contacts/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1contacts~1search/post/requestBody/content/application~1json/example":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"contact_info":{"firstName":{"_ilike":"%john%"}}},{"contact_info":{"lastName":{"_ilike":"%doe%"}}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"contact_info":{"email":{"_ilike":"%@company.com%"}}}]},"orderBy":[{"contact_info":{"lastName":"asc"}},{"createdAt":"desc"}]},"id":"paths/~1gql~1v1~1contacts~1search/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/successful_response":{"value":{"contacts":[{"id":1001,"pms_ref":"C-4451","active":true,"contact_info_id":7001,"office_id":3,"staff_id":null,"type":null,"fwd_email_confirmation":false,"inactivated_at":null,"created_at":"2024-03-01T15:20:11.104223+00:00","updated_at":"2024-09-14T08:02:47.551092+00:00","is_managed_by_aiwyn":false,"is_created_by_aiwyn":false,"username":null,"custom_field_values":null,"contact_info":{"id":7001,"pms_ref":"C-4451","salutation":null,"firstName":"Jane","lastName":"Smith","email":"jane.smith@acme.com","phone":null,"address":"123 Main St","address2":null,"city":"Charlotte","state":"NC","country":"US","zip_code":"28202","active":true},"contact_clients":[{"client_id":122,"contact_id":1001,"pms_ref":"LL-9981","active":true}]}],"total":{"aggregate":{"count":12}}},"key":"successful_response","summary":"One page of contacts","id":"paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/empty_response":{"value":{"contacts":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"No contacts (or offset at/beyond the total)","id":"paths/~1gql~1v1~1contacts~1search/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/found":{"value":{"contact":{"id":1001,"pms_ref":"C-4451","active":true,"contact_info_id":7001,"office_id":3,"staff_id":null,"type":null,"fwd_email_confirmation":false,"inactivated_at":null,"created_at":"2024-03-01T15:20:11.104223+00:00","updated_at":"2024-09-14T08:02:47.551092+00:00","is_managed_by_aiwyn":false,"is_created_by_aiwyn":false,"username":null,"custom_field_values":null,"contact_info":{"id":7001,"pms_ref":"C-4451","salutation":null,"firstName":"Jane","lastName":"Smith","email":"jane.smith@acme.com","phone":null,"address":"123 Main St","address2":null,"city":"Charlotte","state":"NC","country":"US","zip_code":"28202","active":true},"contact_clients":[{"client_id":122,"contact_id":1001,"pms_ref":"LL-9981","active":true}]}},"key":"found","summary":"Contact found","id":"paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/found"},"paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"contact":null},"key":"not_found","summary":"No contact with this id","id":"paths/~1gql~1v1~1contact~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1contact~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id":{"value":{"code":"data-exception","error":"invalid input syntax for type integer: \"abc\"","path":"$"},"key":"non_numeric_id","summary":"Non-numeric id","id":"paths/~1gql~1v1~1contact~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"},"paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/200/content/application~1json/examples/success":{"value":{"contacts":[{"contact_id":23456,"client_id":789,"active":true,"relationship":"PRIMARY","receives_invoice":true,"receives_statement":false,"receives_payment_confirmation":true,"contact":{"id":23456,"pms_ref":"PMS-001","active":true,"type":"CLIENT_CONTACT","fwd_email_confirmation":true,"inactivated_at":null,"created_at":"2024-03-01T15:20:11.104223+00:00","updated_at":"2024-09-14T08:02:47.551092+00:00","is_managed_by_aiwyn":false,"is_created_by_aiwyn":false,"username":null,"custom_field_values":null,"contact_info":{"id":5678,"salutation":"Mr.","firstName":"John","lastName":"Smith","email":"john.smith@acme.com","phone":"+1-555-0123","address":"123 Business Ave","address2":"Suite 400","city":"New York","state":"NY","country":"USA","zip_code":"10001","active":true}}},{"contact_id":23457,"client_id":789,"active":true,"relationship":"BILLING","receives_invoice":true,"receives_statement":true,"receives_payment_confirmation":false,"contact":{"id":23457,"pms_ref":"PMS-002","active":true,"type":"CLIENT_CONTACT","fwd_email_confirmation":false,"inactivated_at":null,"created_at":"2024-03-01T15:20:11.104223+00:00","updated_at":"2024-09-14T08:02:47.551092+00:00","is_managed_by_aiwyn":false,"is_created_by_aiwyn":false,"username":null,"custom_field_values":null,"contact_info":{"id":5679,"salutation":"Ms.","firstName":"Jane","lastName":"Taylor","email":"jane.taylor@acme.com","phone":"+1-555-0456","address":"123 Business Ave","address2":null,"city":"New York","state":"NY","country":"USA","zip_code":"10001","active":true}}}]},"key":"success","summary":"Two active contacts for client 789","id":"paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/400/content/application~1json/examples/non_numeric_id":{"value":{"code":"data-exception","error":"invalid input syntax for type integer: \"abc\"","path":"$"},"key":"non_numeric_id","summary":"Non-numeric clientId","id":"paths/~1gql~1v1~1contacts~1by_client~1{clientId}/get/responses/400/content/application~1json/examples/non_numeric_id"},"paths/~1api~1v1~1contacts~1upsert/post/requestBody/content/application~1json/example":{"value":{"contacts":[{"pmsRef":"CONTACT-001","contactInfo":{"firstName":"Jane","lastName":"Smith","email":"jane.smith@example.com"},"clients":[{"clientRef":"CLIENT-12345","relationship":"Primary Contact","receivesInvoice":true}]},{"pmsRef":"CONTACT-002","contactInfo":{"firstName":"John","lastName":"Doe"}}]},"id":"paths/~1api~1v1~1contacts~1upsert/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1contact_clients/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1contact_clients/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1contact_clients/post/responses/200/content/application~1json/examples/sample":{"value":{"contactClients":[{"id":9001,"pms_ref":"CC-10001","active":true,"client_id":1001,"contact_id":2001,"relationship":"OWNER","receives_invoice":true,"receives_statement":true,"receives_payment_confirmation":false,"sys_refs":{},"created_at":"2025-01-02T03:04:05Z","updated_at":"2025-01-02T03:04:05Z","version":1,"inactivated_at":null,"is_managed_by_aiwyn":false,"is_created_by_aiwyn":false,"custom_field_values":null}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1contact_clients/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1contact_infos/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1contact_infos/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1contact_infos/post/responses/200/content/application~1json/examples/sample":{"value":{"contactInfos":[{"id":3001,"pms_ref":"CI-3001","active":true,"salutation":"Ms.","firstName":"Asha","lastName":"Patel","email":"asha.patel@example.com","phone":"555-0101","address":"123 Main St","address2":"Suite 400","city":"Austin","state":"TX","country":"US","zip_code":"78701","created_at":"2025-01-02T03:04:05Z","updated_at":"2025-01-02T03:04:05Z","version":1,"full_name":"Asha Patel","short_name":"Asha","is_managed_by_aiwyn":false,"is_created_by_aiwyn":false,"job_title":"Controller","prefix":null,"custom_field_values":null}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1contact_infos/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1engagements/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1engagements/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/successful_response":{"value":{"engagements":[{"id":85,"name":"2026 Test 999408","status":"EXECUTED","isActive":true,"endDt":null,"startDt":null,"fiscalYear":2026,"engagementNameTemplate":"2026 Test 999408","createdAt":"2026-06-08T16:40:09.096612+00:00","sentAt":"2026-06-08T16:45:00.414069+00:00","executedAt":"2026-06-08T16:46:48.196882+00:00","isStartOnAcceptance":true,"updatedAt":"2026-06-08T16:46:48.199113+00:00","paymentInfoType":"OPTIONAL","canceledAt":null,"mode":"AUTOMATIC","addressContactInfoId":null,"originatingEngagementId":null,"clientId":92,"jobs":[{"id":1,"jobId":829,"jobServiceTermId":null,"engagementCustomJobServiceTermId":null,"isActive":true,"job":{"id":829,"name":"Expatriate Tax Services","status":"OPEN","clientId":92,"pmsRef":"AIWYN_829","jobRef":null,"sysRefs":{}}}],"partnerStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"managerStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"createdByStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"lastUpdatedByStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"executedByStaff":null,"renewedAt":null}],"total":{"aggregate":{"count":158}}},"key":"successful_response","summary":"One engagement row","id":"paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/empty_response":{"value":{"engagements":[],"total":{"aggregate":{"count":158}}},"key":"empty_response","summary":"Offset beyond the last engagement","id":"paths/~1gql~1v1~1engagements/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1engagements/post/responses/400/content/application~1json/examples/unexpected_variable":{"value":{"code":"bad-request","error":"Unexpected variable clientId"},"key":"unexpected_variable","summary":"Filter sent to the list operation","id":"paths/~1gql~1v1~1engagements/post/responses/400/content/application~1json/examples/unexpected_variable"},"paths/~1gql~1v1~1engagements/post/responses/401/content/application~1json/examples/missing_auth":{"value":{"error":"Authorization header is required","code":"MISSING_AUTH_HEADER"},"key":"missing_auth","summary":"Missing authentication header","id":"paths/~1gql~1v1~1engagements/post/responses/401/content/application~1json/examples/missing_auth"},"paths/~1gql~1v1~1engagements~1search/post/requestBody/content/application~1json/examples/default_search":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"name":{"_ilike":"%review%"}},{"engagementNameTemplate":{"_ilike":"%tax%"}}]},{"status":{"_in":["SENT","EXECUTED"]}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"partnerStaffId":{"_in":[5,6,7,8]}}]},"orderBy":[{"name":"asc"},{"createdAt":"desc"}]},"key":"default_search","summary":"Default search with filtering","id":"paths/~1gql~1v1~1engagements~1search/post/requestBody/content/application~1json/examples/default_search"},"paths/~1gql~1v1~1engagements~1search/post/responses/200/content/application~1json/examples/matching_engagements":{"value":{"engagements":[{"id":85,"name":"2026 Test 999408","status":"EXECUTED","isActive":true,"endDt":null,"startDt":null,"fiscalYear":2026,"engagementNameTemplate":"2026 Test 999408","createdAt":"2026-06-08T16:40:09.096612+00:00","sentAt":"2026-06-08T16:45:00.414069+00:00","executedAt":"2026-06-08T16:46:48.196882+00:00","isStartOnAcceptance":true,"updatedAt":"2026-06-08T16:46:48.199113+00:00","paymentInfoType":"OPTIONAL","canceledAt":null,"mode":"AUTOMATIC","addressContactInfoId":null,"originatingEngagementId":null,"clientId":92,"jobs":[],"partnerStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"managerStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"createdByStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"lastUpdatedByStaff":{"id":18,"firstName":"Robert","lastName":"Johnson","fullName":"Robert Johnson","pmsRef":"AIWYN_18","email":"r.johnson@company.com","createdAt":"2026-06-08T16:26:36.875604+00:00"},"executedByStaff":null,"renewedAt":null}],"total":{"aggregate":{"count":1}}},"key":"matching_engagements","summary":"Engagements matching the filter, with the filtered total","id":"paths/~1gql~1v1~1engagements~1search/post/responses/200/content/application~1json/examples/matching_engagements"},"paths/~1gql~1v1~1engagement~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"engagement":[]},"key":"not_found","summary":"No engagement with this id","id":"paths/~1gql~1v1~1engagement~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1engagement~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id":{"value":{"code":"data-exception","error":"invalid input syntax for type integer: \"abc\"","path":"$"},"key":"non_numeric_id","summary":"Non-numeric id","id":"paths/~1gql~1v1~1engagement~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"},"paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody/content/application~1json/example":{"value":{"fiscalYear":2025,"partnerStaffId":456,"additionalClientIds":[789,790]},"id":"paths/~1api~1v1~1engagements~1{engagementId}/patch/requestBody/content/application~1json/example"},"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/no_fields":{"value":{"message":"No update fields provided","extensions":{"code":400,"details":null}},"key":"no_fields","summary":"No update fields provided","id":"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/no_fields"},"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_clients":{"value":{"message":"Invalid additional client IDs: 999999, 999998","extensions":{"code":400,"details":null}},"key":"invalid_clients","summary":"Unknown additional client","id":"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_clients"},"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_jobs":{"value":{"message":"Invalid job IDs: 999999","extensions":{"code":400,"details":null}},"key":"invalid_jobs","summary":"Unknown job","id":"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/invalid_jobs"},"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/status_locked":{"value":{"message":"Engagement cannot be updated in status: EXECUTED","extensions":{"code":400,"details":null}},"key":"status_locked","summary":"Engagement status does not allow updates","id":"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/400/content/application~1json/examples/status_locked"},"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/404/content/application~1json/examples/not_found":{"value":{"message":"Engagement not found: 12345","extensions":{"code":404,"details":null}},"key":"not_found","summary":"No engagement with this id","id":"paths/~1api~1v1~1engagements~1{engagementId}/patch/responses/404/content/application~1json/examples/not_found"},"paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/minimal":{"value":{"clientId":420,"fiscalYear":2024,"partnerStaffId":53,"managerStaffId":15,"primaryContactId":101,"engagementLetterTemplateId":5},"key":"minimal","summary":"Minimal required fields","id":"paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/minimal"},"paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/full":{"value":{"clientId":420,"fiscalYear":2024,"partnerStaffId":53,"managerStaffId":15,"primaryContactId":101,"secondaryContactId":102,"billingContactId":103,"engagementLetterTemplateId":5,"documentTemplateId":7,"engagementNameTemplate":"{{fiscal_year.year}} {{letter_template.name}} {{client.number}}","startDate":"2024-01-01","endDate":"2024-12-31","ccStaffIds":[20,21],"additionalClientIds":[790,791],"jobIds":[101,102],"additionalDocuments":[{"documentTemplateId":12,"documentType":"CONSENT"}]},"key":"full","summary":"All fields provided","id":"paths/~1api~1v1~1engagements~1create/post/requestBody/content/application~1json/examples/full"},"paths/~1api~1v1~1engagements~1create/post/responses/200/content/application~1json/examples/success":{"value":{"id":34567},"key":"success","summary":"Engagement created","id":"paths/~1api~1v1~1engagements~1create/post/responses/200/content/application~1json/examples/success"},"paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/minimal":{"value":{"batchEngagements":[{"clientId":420,"fiscalYear":2024,"partnerStaffId":53,"managerStaffId":15,"primaryContactId":101},{"clientId":421,"fiscalYear":2024,"partnerStaffId":53,"managerStaffId":15,"primaryContactId":201}]},"key":"minimal","summary":"Two engagements, minimal fields","id":"paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/minimal"},"paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/with_project_template":{"value":{"name":"2024 Annual Batch","projectTemplateId":10,"batchEngagements":[{"clientId":420,"fiscalYear":2024,"partnerStaffId":53,"managerStaffId":15,"primaryContactId":101}]},"key":"with_project_template","summary":"Batch with a shared project template","id":"paths/~1api~1v1~1engagements~1batch~1create/post/requestBody/content/application~1json/examples/with_project_template"},"paths/~1api~1v1~1engagements~1batch~1create/post/responses/200/content/application~1json/examples/success":{"value":{"id":9001},"key":"success","summary":"Batch accepted","id":"paths/~1api~1v1~1engagements~1batch~1create/post/responses/200/content/application~1json/examples/success"},"paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/in_progress":{"value":{"batchId":9001,"status":"CREATING","engagementIds":[34567]},"key":"in_progress","summary":"Batch still creating","id":"paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/in_progress"},"paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/completed":{"value":{"batchId":9001,"status":"CREATED","engagementIds":[34567,34568]},"key":"completed","summary":"Batch fully created","id":"paths/~1api~1v1~1engagements~1batch~1{batchId}~1status/get/responses/200/content/application~1json/examples/completed"},"paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/responses/200/content/application~1json/examples/success":{"value":{"engagementDocuments":[{"id":101,"fileId":5001,"engagementId":34567,"engagementDocumentTypeId":4,"is_active":true,"clientFacing":true,"blocksExecution":true,"signatureRequirementType":"ALL_SIGNATURES_REQUIRED","createdAt":"2024-01-15T10:00:00Z","updatedAt":"2024-03-20T14:30:00Z","affirmativeStatus":"AFFIRMATIVE","documentType":{"id":4,"name":"Consent Document"}},{"id":102,"fileId":5002,"engagementId":34567,"engagementDocumentTypeId":6,"is_active":true,"clientFacing":true,"blocksExecution":false,"signatureRequirementType":"ONE_SIGNATURE_REQUIRED","createdAt":"2024-02-01T09:00:00Z","updatedAt":"2024-02-01T09:00:00Z","affirmativeStatus":"EMPTY","documentType":{"id":6,"name":"Add-On Document"}}]},"key":"success","summary":"Two engagement documents for engagement 34567","id":"paths/~1gql~1v1~1engagement_documents~1by_engagement~1{engagementId}/get/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1projects/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1projects/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1projects~1search/post/requestBody/content/application~1json/example":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"name":{"_ilike":"%migration%"}},{"serviceDescription":{"_ilike":"%review%"}}]},{"isActive":{"_eq":true}},{"updatedAt":{"_gte":"1900-01-01T00:00:00Z"}},{"partnerStaffId":{"_in":[101,102,103]}}]},"orderBy":[{"updatedAt":"desc"},{"name":"asc"}]},"id":"paths/~1gql~1v1~1projects~1search/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1projects~1search/post/responses/200/content/application~1json/examples/projects":{"value":{"projects":[{"id":5012,"name":"Q1 Financial Review 2024","startDate":"2024-01-01T00:00:00Z","targetEndDate":"2024-03-31T23:59:59Z","dueDate":"2024-03-15T00:00:00Z","targetStartDate":"2023-12-01T00:00:00Z","pmsRef":"JOB-2024-115","isCreatedByAiwyn":true,"managerStaffId":102,"partnerStaffId":101,"status":"ACTIVE","updatedAt":"2024-05-20T12:34:56.123456+00:00","jobStatus":{"id":4,"name":"In Progress","state":"ACTIVE"},"client":{"id":2180,"name":"TechFlow Enterprises","clientRef":"TF-2024-789","clientGroup":{"id":12,"name":"Enterprise"}},"managerStaff":{"id":102,"firstName":"Lisa","lastName":"Rodriguez","email":"lisa.rodriguez@company.com"},"partnerStaff":{"id":101,"firstName":"Michael","lastName":"Chen","email":"michael.chen@company.com"}}],"total":{"aggregate":{"count":137}}},"key":"projects","summary":"A page of projects","id":"paths/~1gql~1v1~1projects~1search/post/responses/200/content/application~1json/examples/projects"},"paths/~1gql~1v1~1project~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"project":[]},"key":"not_found","summary":"No project with this id","id":"paths/~1gql~1v1~1project~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1project~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id":{"value":{"code":"data-exception","error":"invalid input syntax for type integer: \"abc\"","path":"$"},"key":"non_numeric_id","summary":"Non-numeric id","id":"paths/~1gql~1v1~1project~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"},"paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/minimal":{"value":{"clientId":420,"jobTemplates":[{"jobTemplateId":7}]},"key":"minimal","summary":"Single job from template, no overrides","id":"paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/minimal"},"paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/full":{"value":{"clientId":420,"jobTemplates":[{"jobTemplateId":7,"startDate":"2025-01-01","name":"Tax Return 2024","serviceDescription":"Annual federal and state tax preparation","estimationHours":8.5,"feeAmount":1500,"requiredPrepayment":500,"includeWipType":"INCLUDE_WIP_IF_FINAL"},{"jobTemplateId":12,"startDate":"2025-02-01","name":"Bookkeeping Q1 2025"}]},"key":"full","summary":"Multiple jobs with field overrides","id":"paths/~1api~1v1~1projects~1create_from_template/post/requestBody/content/application~1json/examples/full"},"paths/~1api~1v1~1projects~1create_from_template/post/responses/201/content/application~1json/examples/success":{"value":[1001,1002],"key":"success","summary":"Two jobs created","id":"paths/~1api~1v1~1projects~1create_from_template/post/responses/201/content/application~1json/examples/success"},"paths/~1api~1v1~1projects~1assign_staff/post/requestBody/content/application~1json/example":{"value":{"jobId":5001,"staffJobAssignments":[{"staffId":103},{"staffId":104}],"staffTaskAssignments":[{"staffId":103,"taskTypeId":10},{"staffId":104,"taskTypeId":11}]},"id":"paths/~1api~1v1~1projects~1assign_staff/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1projects~1remove_staff/post/requestBody/content/application~1json/example":{"value":{"jobId":5001,"staffJobAssignments":[{"staffId":103},{"staffId":104}],"staffTaskAssignments":[{"staffId":103,"taskTypeId":10},{"staffId":104,"taskTypeId":11}]},"id":"paths/~1api~1v1~1projects~1remove_staff/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1jobs/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1jobs/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1jobs/post/responses/200/content/application~1json/examples/sample":{"value":{"jobs":[{"id":5012,"pmsRef":"JOB-5012","jobRef":"J-0005012","name":"Q1 Financial Review 2025","status":"ACTIVE","isActive":true,"clientId":1001,"deptId":7,"officeId":2,"jobTemplateId":300,"managerStaffId":102,"partnerStaffId":101,"startDate":"2025-01-01T00:00:00Z","endDate":"2025-03-31T23:59:59Z","dueDate":"2025-03-31T23:59:59Z","targetStartDate":"2025-01-01T00:00:00Z","targetedStartDate":"2025-01-01T00:00:00Z","targetEndDate":"2025-03-31T23:59:59Z","targetedEndDate":"2025-03-31T23:59:59Z","feeStructureId":42,"feeStructureV4":{"id":42,"type":"FIXED","amount":5000,"active":true},"sysRefs":{},"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-03T10:11:12Z","customFieldValues":{"industry_niche":"Manufacturing","naics_code":"333120"},"version":3}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1jobs/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1job~1{id}/get/responses/200/content/application~1json/examples/sample":{"value":{"job":[{"id":5012,"pmsRef":"JOB-5012","jobRef":"J-0005012","name":"Q1 Financial Review 2025","status":"ACTIVE","isActive":true,"clientId":1001,"deptId":7,"officeId":2,"jobTemplateId":300,"managerStaffId":102,"partnerStaffId":101,"startDate":"2025-01-01T00:00:00Z","endDate":"2025-03-31T23:59:59Z","dueDate":"2025-03-31T23:59:59Z","targetStartDate":"2025-01-01T00:00:00Z","targetedStartDate":"2025-01-01T00:00:00Z","targetEndDate":"2025-03-31T23:59:59Z","targetedEndDate":"2025-03-31T23:59:59Z","feeStructureId":42,"feeStructureV4":{"id":42,"type":"FIXED","amount":5000,"active":true},"sysRefs":{},"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-03T10:11:12Z","customFieldValues":{"industry_niche":"Manufacturing","naics_code":"333120"},"version":3}]},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1job~1{id}/get/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1job_templates/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1job_templates/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1job_templates/post/responses/200/content/application~1json/examples/sample":{"value":{"jobTemplates":[{"id":300,"pmsRef":"JT-300","ref":"1040","name":"Individual Tax Return","active":true,"serviceLineId":10,"isCreatedByAiwyn":true,"isManagedByAiwyn":true,"sysRefs":{},"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-02T03:04:05Z","version":1}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1job_templates/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1draft_invoice_histories/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1draft_invoice_histories/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1draft_invoice_histories/post/responses/200/content/application~1json/examples/successful_response":{"value":{"draftInvoices":[{"clientId":7720,"invoiceId":125890,"jobId":2514,"client":{"active":true,"clientRef":"TF-2024-789","name":"TechFlow Enterprises","pmsRef":"240815"},"draftInvoice":{"approvedAt":"2024-03-15T14:32:18+00:00","arTranId":125890,"approverStaffId":301,"approvedByStaffId":301,"invoiceId":125890,"isActive":true,"pms_invoice_number":"INV-2024-4850","status":"APPROVED","attachTimeEntries":false,"automaticallyBillOn":null,"billAddressContactInfoId":4410,"billerStaffId":301,"createdAt":"2024-05-12T22:50:20.595961+00:00","createdByStaffId":301,"currentAssignedStaffId":301,"deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","expenseLineItemStrategy":"HIDE","invoiceDate":null,"lineItemStrategy":"JOB","postOn":null,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"reviewedAt":"2024-03-14T10:05:00+00:00","reviewedByStaffId":301,"reviewerStaffId":301,"scheduledByStaffId":null,"senderStaffId":301,"timeEntryGrouping":null,"timeEntryPageOrientation":null,"updatedAt":"2024-05-12T22:50:20.595961+00:00","wipUnbilledAsOf":null}}],"total":{"aggregate":{"count":94}}},"key":"successful_response","summary":"Draft invoice histories with client and draft invoice details","id":"paths/~1gql~1v1~1draft_invoice_histories/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody/content/application~1json/example":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"clientId":{"_in":[1001,1002]}},{"jobId":{"_in":[2001,2002]}}]},{"client":{"active":{"_eq":true}}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"activityType":{"_in":["DRAFT_INVOICE_CREATED","DRAFT_INVOICE_RECONCILED"]}}]},"orderBy":[{"clientId":"asc"},{"createdAt":"desc"}]},"id":"paths/~1gql~1v1~1draft_invoice_histories~1search/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1draft_invoice_histories~1search/post/responses/200/content/application~1json/examples/successful_response":{"value":{"draftInvoices":[{"clientId":7720,"invoiceId":125890,"jobId":2514,"client":{"active":true,"clientRef":"TF-2024-789","name":"TechFlow Enterprises","pmsRef":"240815"},"draftInvoice":{"approvedAt":"2024-03-15T14:32:18+00:00","arTranId":125890,"approverStaffId":301,"approvedByStaffId":301,"invoiceId":125890,"isActive":true,"pms_invoice_number":"INV-2024-4850","status":"APPROVED","attachTimeEntries":false,"automaticallyBillOn":null,"billAddressContactInfoId":4410,"billerStaffId":301,"createdAt":"2024-05-12T22:50:20.595961+00:00","createdByStaffId":301,"currentAssignedStaffId":301,"deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","expenseLineItemStrategy":"HIDE","invoiceDate":null,"lineItemStrategy":"JOB","postOn":null,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"reviewedAt":"2024-03-14T10:05:00+00:00","reviewedByStaffId":301,"reviewerStaffId":301,"scheduledByStaffId":null,"senderStaffId":301,"timeEntryGrouping":null,"timeEntryPageOrientation":null,"updatedAt":"2024-05-12T22:50:20.595961+00:00","wipUnbilledAsOf":null}}],"total":{"aggregate":{"count":12}}},"key":"successful_response","summary":"Filtered draft invoice histories","id":"paths/~1gql~1v1~1draft_invoice_histories~1search/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/found":{"value":{"draft_invoice_history":[{"clientId":7720,"invoiceId":125890,"jobId":2514,"client":{"active":true,"clientRef":"TF-2024-789","name":"TechFlow Enterprises","pmsRef":"240815"},"draftInvoice":{"approvedAt":"2024-03-15T14:32:18+00:00","arTranId":125880,"approverStaffId":301,"approvedByStaffId":301,"invoiceId":125890,"isActive":true,"pms_invoice_number":null,"status":"APPROVED","attachTimeEntries":false,"automaticallyBillOn":null,"billAddressContactInfoId":4410,"billerStaffId":301,"createdAt":"2024-05-12T22:50:20.595961+00:00","createdByStaffId":301,"currentAssignedStaffId":301,"deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","expenseLineItemStrategy":"HIDE","invoiceDate":null,"lineItemStrategy":"JOB","postOn":null,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"reviewedAt":"2024-03-14T10:05:00+00:00","reviewedByStaffId":301,"reviewerStaffId":301,"scheduledByStaffId":null,"senderStaffId":301,"timeEntryGrouping":null,"timeEntryPageOrientation":null,"updatedAt":"2024-05-12T22:50:20.595961+00:00","wipUnbilledAsOf":null}}]},"key":"found","summary":"Record found","id":"paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/found"},"paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"draft_invoice_history":[]},"key":"not_found","summary":"No record for this invoice id","id":"paths/~1gql~1v1~1draft_invoice_history~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1invoices/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1invoices/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/successful_response":{"value":{"invoices":[{"arTranId":125890,"invoiceNumber":"INV-2024-4850","dueDate":"2024-04-24T05:00:00","status":"POSTED","tax":0,"interest":0,"description":null,"createdAt":"2024-05-12T22:50:20.595961+00:00","updatedAt":"2024-05-12T22:50:20.595961+00:00","postedAt":"2024-05-12T22:50:20.595961+00:00","deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","invoiceFileId":88231,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"ar_tran":{"id":125890,"pmsRef":"240815","transactionDate":"2024-03-22T05:00:00","amount":4250,"allocated":4250,"clientId":7720,"allocatedInCurrency":null,"amountInCurrency":null,"businessEntityId":1,"createdAt":"2024-05-12T22:50:20.595961+00:00","currencyId":null,"customFieldValues":null,"exchangeRate":null,"internalNotes":null,"isActive":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":false,"isPosted":true,"isReconciled":null,"managerStaffId":301,"notes":null,"partnerStaffId":302,"pmsCreatedAt":"2024-03-22T05:00:00","projectId":2514,"responsibleStaffId":303,"type":"Invoice","updatedAt":"2024-05-12T22:50:20.595961+00:00"}},{"arTranId":125234,"invoiceNumber":"INV-2024-4721","dueDate":"2024-03-03T05:00:00","status":"POSTED","tax":0,"interest":0,"description":null,"createdAt":"2024-05-12T22:50:10.982058+00:00","updatedAt":"2024-05-12T22:50:10.982058+00:00","postedAt":"2024-05-12T22:50:20.595961+00:00","deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","invoiceFileId":88231,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"ar_tran":{"id":125234,"pmsRef":"239842","transactionDate":"2024-02-04T05:00:00","amount":3750,"allocated":3750,"clientId":7720,"allocatedInCurrency":null,"amountInCurrency":null,"businessEntityId":1,"createdAt":"2024-05-12T22:50:20.595961+00:00","currencyId":null,"customFieldValues":null,"exchangeRate":null,"internalNotes":null,"isActive":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":false,"isPosted":true,"isReconciled":null,"managerStaffId":301,"notes":null,"partnerStaffId":302,"pmsCreatedAt":"2024-03-22T05:00:00","projectId":2514,"responsibleStaffId":303,"type":"Invoice","updatedAt":"2024-05-12T22:50:20.595961+00:00"}},{"arTranId":124856,"invoiceNumber":"INV-2024-4592","dueDate":"2024-02-07T05:00:00","status":"POSTED","tax":0,"interest":0,"description":null,"createdAt":"2024-05-12T22:50:09.194501+00:00","updatedAt":"2024-05-12T22:50:09.194501+00:00","postedAt":"2024-05-12T22:50:20.595961+00:00","deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","invoiceFileId":88231,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"ar_tran":{"id":124856,"pmsRef":"238967","transactionDate":"2024-01-08T05:00:00","amount":2850,"allocated":2850,"clientId":7720,"allocatedInCurrency":null,"amountInCurrency":null,"businessEntityId":1,"createdAt":"2024-05-12T22:50:20.595961+00:00","currencyId":null,"customFieldValues":null,"exchangeRate":null,"internalNotes":null,"isActive":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":false,"isPosted":true,"isReconciled":null,"managerStaffId":301,"notes":null,"partnerStaffId":302,"pmsCreatedAt":"2024-03-22T05:00:00","projectId":2514,"responsibleStaffId":303,"type":"Invoice","updatedAt":"2024-05-12T22:50:20.595961+00:00"}}],"total":{"aggregate":{"count":94}}},"key":"successful_response","summary":"Invoice records with AR transaction details","id":"paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/real_api_response":{"value":{"invoices":[{"arTranId":119859,"invoiceNumber":"4618","dueDate":"2023-03-24T05:00:00","status":"POSTED","tax":0,"interest":0,"description":null,"createdAt":"2023-05-12T22:50:20.595961+00:00","updatedAt":"2023-05-12T22:50:20.595961+00:00","postedAt":"2024-05-12T22:50:20.595961+00:00","deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","invoiceFileId":88231,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"ar_tran":{"id":119859,"pmsRef":"224081","transactionDate":"2023-02-22T05:00:00","amount":0,"allocated":0,"clientId":7720,"allocatedInCurrency":null,"amountInCurrency":null,"businessEntityId":1,"createdAt":"2024-05-12T22:50:20.595961+00:00","currencyId":null,"customFieldValues":null,"exchangeRate":null,"internalNotes":null,"isActive":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":false,"isPosted":true,"isReconciled":null,"managerStaffId":301,"notes":null,"partnerStaffId":302,"pmsCreatedAt":"2024-03-22T05:00:00","projectId":2514,"responsibleStaffId":303,"type":"Invoice","updatedAt":"2024-05-12T22:50:20.595961+00:00"}},{"arTranId":96162,"invoiceNumber":"74080","dueDate":"2018-10-11T04:00:00","status":"POSTED","tax":0,"interest":0,"description":null,"createdAt":"2023-05-12T22:50:08.928921+00:00","updatedAt":"2023-05-12T22:50:08.928921+00:00","postedAt":"2024-05-12T22:50:20.595961+00:00","deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","invoiceFileId":88231,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"ar_tran":{"id":96162,"pmsRef":"108840","transactionDate":"2018-09-11T04:00:00","amount":3516,"allocated":3516,"clientId":7720,"allocatedInCurrency":null,"amountInCurrency":null,"businessEntityId":1,"createdAt":"2024-05-12T22:50:20.595961+00:00","currencyId":null,"customFieldValues":null,"exchangeRate":null,"internalNotes":null,"isActive":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":false,"isPosted":true,"isReconciled":null,"managerStaffId":301,"notes":null,"partnerStaffId":302,"pmsCreatedAt":"2024-03-22T05:00:00","projectId":2514,"responsibleStaffId":303,"type":"Invoice","updatedAt":"2024-05-12T22:50:20.595961+00:00"}}],"total":{"aggregate":{"count":94}}},"key":"real_api_response","summary":"Sample from actual API response","id":"paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/real_api_response"},"paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/empty_response":{"value":{"invoices":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"No invoices found","id":"paths/~1gql~1v1~1invoices/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1invoices/post/responses/400/content/application~1json/examples/unexpected_variable":{"value":{"path":"$","error":"Unexpected variable clientId","code":"bad-request"},"key":"unexpected_variable","summary":"Body property other than pageSize/page","id":"paths/~1gql~1v1~1invoices/post/responses/400/content/application~1json/examples/unexpected_variable"},"paths/~1gql~1v1~1invoices/post/responses/401/content/application~1json/examples/missing_auth":{"value":{"error":"Authorization header is required","code":"MISSING_AUTH_HEADER"},"key":"missing_auth","summary":"Missing authentication header","id":"paths/~1gql~1v1~1invoices/post/responses/401/content/application~1json/examples/missing_auth"},"paths/~1gql~1v1~1invoices~1search/post/requestBody/content/application~1json/example":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"invoiceNumber":{"_ilike":"%2024%"}},{"description":{"_ilike":"%service%"}}]},{"status":{"_in":["POSTED","CLOSED"]}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"dueDate":{"_gte":"2024-01-01T00:00:00"}}]},"orderBy":[{"invoiceNumber":"asc"},{"createdAt":"desc"}]},"id":"paths/~1gql~1v1~1invoices~1search/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/found":{"value":{"invoice":{"arTranId":45678,"invoiceNumber":"INV-2024-001","dueDate":"2024-12-31T23:59:59","status":"POSTED","tax":2000,"interest":0,"description":"Q4 Financial Audit","createdAt":"2024-12-01T09:00:00Z","updatedAt":"2024-12-15T10:30:00Z","postedAt":"2024-05-12T22:50:20.595961+00:00","deliveryMethod":"EMAIL","emailRecipients":"ap@techflow.example","invoiceFileId":88231,"reversalReason":null,"reversedAt":null,"reversedByStaffId":null,"ar_tran":{"id":45678,"pmsRef":"AR-2024-045678","transactionDate":"2024-12-01T00:00:00","amount":22000,"allocated":15000,"clientId":789,"allocatedInCurrency":null,"amountInCurrency":null,"businessEntityId":1,"createdAt":"2024-05-12T22:50:20.595961+00:00","currencyId":null,"customFieldValues":null,"exchangeRate":null,"internalNotes":null,"isActive":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":false,"isPosted":true,"isReconciled":null,"managerStaffId":301,"notes":null,"partnerStaffId":302,"pmsCreatedAt":"2024-03-22T05:00:00","projectId":2514,"responsibleStaffId":303,"type":"Invoice","updatedAt":"2024-05-12T22:50:20.595961+00:00"}}},"key":"found","summary":"Invoice found","id":"paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/found"},"paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"invoice":null},"key":"not_found","summary":"No invoice with this id","id":"paths/~1gql~1v1~1invoice~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1api~1v1~1invoices~1unpaid/get/responses/200/content/application~1json/example":{"value":{"data":{"client":{"id":7720,"clientRef":"ACME-001","name":"Acme Corporation"},"invoices":[{"id":125890,"invoiceNumber":"INV-2026-4850","description":"2025 individual tax return","status":"POSTED","transactionDate":"2026-08-01","dueDate":"2026-08-31","amount":"1250.00","allocated":"250.00","outstanding":"1000.00"}]},"error":null,"meta":{"success":true,"message":"Unpaid invoices retrieved successfully","timestamp":"2026-09-02T14:03:11.412Z"}},"id":"paths/~1api~1v1~1invoices~1unpaid/get/responses/200/content/application~1json/example"},"paths/~1gql~1v1~1payments/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1payments/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/successful_response":{"value":{"payments":[{"payment_ar_tran_id":1048,"ar_transaction_date":"2026-09-01T15:00:34.317714","client_name":"Client Test","client_ref":"1337","invoice_numbers":null,"is_aiwyn_payment":true,"is_partial_payment":false,"is_payment_success":true,"notes":"inv 33","engagement_names":null,"paid_by_full_name":"Client Test","payment_payment_method":"Bank Transfer","payment_pp_id":"pi_3UAtArIog7gyKVjp2xxxxx","refund_date":null,"refund_status":null,"staff_admin_id":true,"status":"Completed","total_bill_amount":null,"amount":10,"principal":10,"total_processing_fee_amount":0,"total_international_fee_amount":0,"total_late_fee_amount":0,"is_posted":false,"posted_to_bank_dt":null,"estimated_deposit_date":null,"dispute_status":null,"dispute_refund_date":null,"total_bill_amount_in_currency":null,"amount_in_currency":null,"principal_in_currency":null,"total_processing_fee_amount_in_currency":null,"total_international_fee_amount_in_currency":null,"total_late_fee_amount_in_currency":null,"currency_code":null,"card_type":"visa","last4":"4242","failure_reason":null,"failed_at":null,"payment_confirmation_date":"2026-09-01T15:00:34.317714","payment_source":"CLIENT_PORTAL","payment":{"application_fee_amount":null,"company_name":null,"created_at":"2026-09-01T15:00:34.317714+00:00","created_by_contact_id":null,"created_by_staff_id":null,"firm_bank_account_id":null,"is_manual":false,"payor_name":null,"posted_to_bank":false,"refunded_amount":null,"updated_at":"2026-09-01T15:00:34.317714+00:00"}}],"total":{"aggregate":{"count":97}}},"key":"successful_response","summary":"Typical response with payment data","id":"paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/empty_response":{"value":{"payments":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"No payments (or offset at/beyond total)","id":"paths/~1gql~1v1~1payments/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1payments/post/responses/400/content/application~1json/examples/unexpected_variable":{"value":{"path":"$","error":"Unexpected variable clientId","code":"bad-request"},"key":"unexpected_variable","summary":"Body property other than pageSize/page","id":"paths/~1gql~1v1~1payments/post/responses/400/content/application~1json/examples/unexpected_variable"},"paths/~1gql~1v1~1payments/post/responses/401/content/application~1json/examples/missing_auth":{"value":{"error":"Authorization header is required","code":"MISSING_AUTH_HEADER"},"key":"missing_auth","summary":"Missing authentication header","id":"paths/~1gql~1v1~1payments/post/responses/401/content/application~1json/examples/missing_auth"},"paths/~1gql~1v1~1payments/post/responses/403/content/application~1json/examples/insufficient_permissions":{"value":{"error":"Access to payment data requires elevated permissions","code":"INSUFFICIENT_PAYMENT_PERMISSIONS"},"key":"insufficient_permissions","summary":"Insufficient permissions for payment data","id":"paths/~1gql~1v1~1payments/post/responses/403/content/application~1json/examples/insufficient_permissions"},"paths/~1gql~1v1~1payments~1search/post/requestBody/content/application~1json/example":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"payment_payment_method":{"_ilike":"%card%"}},{"client_name":{"_ilike":"%Acme%"}}]},{"is_payment_success":{"_eq":true}},{"ar_transaction_date":{"_gte":"1900-01-01T00:00:00"}}]},"orderBy":[{"ar_transaction_date":"desc"},{"client_name":"asc"}]},"id":"paths/~1gql~1v1~1payments~1search/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/invoiceLocked":{"value":{"clientRef":"ACME-001","invoiceIds":[125890],"note":"2025 individual tax return","returnUrl":"https://app.safesend.example/returns/42","returnLabel":"SafeSend","returnAutomatically":true,"metadata":{"returnId":"R-42"}},"key":"invoiceLocked","summary":"Quick payment link locked to one invoice, returning to the caller afterwards","id":"paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/invoiceLocked"},"paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/amountOnly":{"value":{"clientRef":"ACME-001","amount":"500.00","note":"Retainer"},"key":"amountOnly","summary":"Quick payment link for an amount with no invoice","id":"paths/~1api~1v1~1clients~1v1~1link~1payment/post/requestBody/content/application~1json/examples/amountOnly"},"paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/success":{"value":{"taskTypes":[{"id":1,"pmsRef":"TAX-PREP","code":"TXPRP","display":"Tax Preparation","description":"Federal and state income tax preparation","billable":true,"taxable":false,"active":true,"customHourlyRate":275,"rateTypeId":3,"taskTypeCategoryId":2,"serviceLineId":5,"projectsUsedInCount":42,"invoicesUsedInCount":118,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"createdAt":"2023-01-15T08:00:00Z","updatedAt":"2024-06-01T12:30:00Z","version":3,"createdByStaffId":412,"lastUpdatedByStaffId":415},{"id":2,"pmsRef":"AUDIT","code":"AUDIT","display":"Audit","description":null,"billable":true,"taxable":false,"active":true,"customHourlyRate":null,"rateTypeId":null,"taskTypeCategoryId":1,"serviceLineId":2,"projectsUsedInCount":17,"invoicesUsedInCount":53,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"createdAt":"2023-01-15T08:00:00Z","updatedAt":"2023-01-15T08:00:00Z","version":1,"createdByStaffId":412,"lastUpdatedByStaffId":415}],"total":{"aggregate":{"count":25}}},"key":"success","summary":"Task types retrieved","id":"paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/empty":{"value":{"taskTypes":[],"total":{"aggregate":{"count":0}}},"key":"empty","summary":"No task types found","id":"paths/~1gql~1v1~1task-types/get/responses/200/content/application~1json/examples/empty"},"paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/billable_active":{"value":{"pageSize":25,"page":0,"where":{"_and":[{"billable":{"_eq":true}},{"active":{"_eq":true}}]},"orderBy":[{"display":"asc"}]},"key":"billable_active","summary":"All active billable task types","id":"paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/billable_active"},"paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_service_line":{"value":{"pageSize":50,"page":0,"where":{"serviceLineId":{"_eq":2}}},"key":"by_service_line","summary":"Task types for a specific service line","id":"paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_service_line"},"paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_code":{"value":{"pageSize":1,"page":0,"where":{"code":{"_eq":"TXPRP"}}},"key":"by_code","summary":"Exact code lookup","id":"paths/~1gql~1v1~1task-types~1search/post/requestBody/content/application~1json/examples/by_code"},"paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/success":{"value":{"taskTypes":[{"id":1,"pmsRef":"TAX-PREP","code":"TXPRP","display":"Tax Preparation","description":"Federal and state income tax preparation","billable":true,"taxable":false,"active":true,"customHourlyRate":275,"rateTypeId":3,"taskTypeCategoryId":2,"serviceLineId":5,"projectsUsedInCount":42,"invoicesUsedInCount":118,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"createdAt":"2023-01-15T08:00:00Z","updatedAt":"2024-06-01T12:30:00Z","version":3,"createdByStaffId":412,"lastUpdatedByStaffId":415}],"total":{"aggregate":{"count":12}}},"key":"success","summary":"Active billable task types returned","id":"paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/empty":{"value":{"taskTypes":[],"total":{"aggregate":{"count":0}}},"key":"empty","summary":"No task types matched the filter","id":"paths/~1gql~1v1~1task-types~1search/post/responses/200/content/application~1json/examples/empty"},"paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/success":{"value":{"tasks":[{"id":456,"name":"Q4 Financial Statement Review","overrideName":null,"status":"IN_PROGRESS","pmsRef":"TASK-001","jobId":67890,"taskTypeId":1,"assigneeStaffId":123,"startDate":"2024-10-01","dueDate":"2024-12-31","targetStartDate":"2024-09-15","targetDueDate":"2024-12-15","estimatedHours":40,"completedAt":null,"description":"Review and analyse Q4 financial statements including variance analysis","ordinal":1,"parentTaskId":null,"jobTemplateTaskId":10,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"createdAt":"2024-09-01T08:00:00Z","updatedAt":"2024-10-01T09:30:00Z","createdByStaffId":412,"lastUpdatedByStaffId":415,"taskSectionId":8,"task":{"active":true,"customFieldValues":{}},"taskType":{"id":1,"code":"TXPRP","display":"Tax Preparation","billable":true,"taxable":false,"active":true},"assigneeStaff":{"id":123,"firstName":"John","lastName":"Smith","email":"john.smith@firm.com"},"job":{"id":67890}}]},"key":"success","summary":"Task found","id":"paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"tasks":[]},"key":"not_found","summary":"Task not found","id":"paths/~1gql~1v1~1task~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_task_type_and_assignee":{"value":{"pageSize":25,"page":0,"where":{"_and":[{"taskType":{"code":{"_eq":"PREP"}}},{"assigneeStaffId":{"_eq":789}}]},"orderBy":[{"dueDate":"asc"}]},"key":"by_task_type_and_assignee","summary":"Tasks of a specific type assigned to a staff member","id":"paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_task_type_and_assignee"},"paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_client":{"value":{"pageSize":50,"page":0,"where":{"job":{"clientId":{"_eq":456}}}},"key":"by_client","summary":"All tasks for a specific client","id":"paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/by_client"},"paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/due_date_range":{"value":{"pageSize":50,"page":0,"where":{"dueDate":{"_gte":"2024-01-01","_lte":"2024-12-31"}},"orderBy":[{"dueDate":"asc"}]},"key":"due_date_range","summary":"Tasks due within a date range","id":"paths/~1gql~1v1~1tasks~1search/post/requestBody/content/application~1json/examples/due_date_range"},"paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/success":{"value":{"tasks":[{"id":456,"name":"Q4 Financial Statement Review","overrideName":null,"status":"IN_PROGRESS","pmsRef":"TASK-001","jobId":67890,"taskTypeId":1,"assigneeStaffId":789,"startDate":"2024-10-01","dueDate":"2024-12-31","targetStartDate":"2024-09-15","targetDueDate":"2024-12-15","estimatedHours":40,"completedAt":null,"description":"Review and analyse Q4 financial statements","ordinal":1,"parentTaskId":null,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"createdAt":"2024-09-01T08:00:00Z","updatedAt":"2024-10-01T09:30:00Z","createdByStaffId":412,"lastUpdatedByStaffId":415,"taskSectionId":8,"jobTemplateTaskId":10,"task":{"active":true,"customFieldValues":{}},"taskType":{"id":1,"code":"PREP","display":"Tax Preparation","billable":true,"taxable":false,"active":true},"assigneeStaff":{"id":789,"firstName":"Jane","lastName":"Doe","email":"jane.doe@firm.com"},"job":{"id":67890}}],"total":{"aggregate":{"count":84}}},"key":"success","summary":"Tasks returned","id":"paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/empty":{"value":{"tasks":[],"total":{"aggregate":{"count":0}}},"key":"empty","summary":"No tasks matched the filter","id":"paths/~1gql~1v1~1tasks~1search/post/responses/200/content/application~1json/examples/empty"},"paths/~1gql~1v1~1wip/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":25,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1wip/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/successful_response":{"value":{"acme_vw_wip_unified":[{"id":850321,"wipType":"Time","loggedDate":"2024-01-17T05:00:00","wipValue":1250,"wipValueOutstanding":0,"billedAmount":1225,"writeOffAmount":25,"notes":"Consultation and analysis for Q1 financial review","clientId":1561,"jobId":2514,"isActive":true,"createdAt":"2024-05-12T23:02:33.24516+00:00","updatedAt":"2024-05-12T23:02:33.24516+00:00","approvedDate":"2024-01-18T05:00:00","approvedStaffId":412,"billedPerUnit":250,"costPerUnit":95,"customFieldValues":{},"deptId":3,"isApproved":true,"isCreatedByAiwyn":false,"isLocked":false,"isManagedByAiwyn":false,"isPosted":true,"loggedStaffId":412,"officeId":2,"pmsRef":"1789456","postedDate":"2024-01-19T05:00:00","postedStaffId":415,"rawUnits":5,"serviceLineId":4,"staffTypeId":7,"taskTypeId":12,"units":5,"updatedByStaffId":415,"client":{"id":1561,"name":"TechFlow Enterprises"}},{"id":850142,"wipType":"Expense","loggedDate":"2024-01-15T05:00:00","wipValue":350,"wipValueOutstanding":0,"billedAmount":343.5,"writeOffAmount":6.5,"notes":null,"clientId":1561,"jobId":2514,"isActive":true,"createdAt":"2024-05-12T23:00:05.824148+00:00","updatedAt":"2024-05-12T23:00:05.824148+00:00","approvedDate":"2024-01-18T05:00:00","approvedStaffId":412,"billedPerUnit":250,"costPerUnit":95,"customFieldValues":{},"deptId":3,"isApproved":true,"isCreatedByAiwyn":false,"isLocked":false,"isManagedByAiwyn":false,"isPosted":true,"loggedStaffId":412,"officeId":2,"pmsRef":"1789456","postedDate":"2024-01-19T05:00:00","postedStaffId":415,"rawUnits":5,"serviceLineId":4,"staffTypeId":7,"taskTypeId":12,"units":5,"updatedByStaffId":415,"client":{"id":1561,"name":"TechFlow Enterprises"}},{"id":849987,"wipType":"Time","loggedDate":"2024-01-12T05:00:00","wipValue":875,"wipValueOutstanding":125,"billedAmount":750,"writeOffAmount":0,"notes":"Document review and preparation","clientId":1561,"jobId":2514,"isActive":true,"createdAt":"2024-05-12T23:00:07.784813+00:00","updatedAt":"2024-05-12T23:00:07.784813+00:00","approvedDate":"2024-01-18T05:00:00","approvedStaffId":412,"billedPerUnit":250,"costPerUnit":95,"customFieldValues":{},"deptId":3,"isApproved":true,"isCreatedByAiwyn":false,"isLocked":false,"isManagedByAiwyn":false,"isPosted":true,"loggedStaffId":412,"officeId":2,"pmsRef":"1789456","postedDate":"2024-01-19T05:00:00","postedStaffId":415,"rawUnits":5,"serviceLineId":4,"staffTypeId":7,"taskTypeId":12,"units":5,"updatedByStaffId":415,"client":{"id":1561,"name":"TechFlow Enterprises"}}],"acme_vw_wip_unified_aggregate":{"aggregate":{"count":84,"sum":{"wipValue":24186.15,"billedAmount":19612.07,"wipValueOutstanding":125}}}},"key":"successful_response","summary":"WIP records with financial tracking and aggregations","id":"paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/real_api_response":{"value":{"acme_vw_wip_unified":[{"id":743292,"wipType":"Time","loggedDate":"2018-01-17T05:00:00","wipValue":127.5,"wipValueOutstanding":0,"billedAmount":0,"writeOffAmount":127.5,"notes":"Velit aut provident sint dolorum eaque necessitatibus dicta reprehenderit eveniet dolore eius neque est.","clientId":1561,"jobId":2514,"isActive":true,"createdAt":"2023-05-12T23:02:33.24516+00:00","updatedAt":"2023-05-12T23:02:33.24516+00:00","approvedDate":"2024-01-18T05:00:00","approvedStaffId":412,"billedPerUnit":250,"costPerUnit":95,"customFieldValues":{},"deptId":3,"isApproved":true,"isCreatedByAiwyn":false,"isLocked":false,"isManagedByAiwyn":false,"isPosted":true,"loggedStaffId":412,"officeId":2,"pmsRef":"1789456","postedDate":"2024-01-19T05:00:00","postedStaffId":415,"rawUnits":5,"serviceLineId":4,"staffTypeId":7,"taskTypeId":12,"units":5,"updatedByStaffId":415,"client":{"id":1561,"name":"Cammie Cremin"}},{"id":510044,"wipType":"Time","loggedDate":"2016-03-23T04:00:00","wipValue":87.5,"wipValueOutstanding":0,"billedAmount":86.05,"writeOffAmount":1.45,"notes":null,"clientId":1561,"jobId":2514,"isActive":true,"createdAt":"2023-05-12T23:00:05.824148+00:00","updatedAt":"2023-05-12T23:00:05.824148+00:00","approvedDate":"2024-01-18T05:00:00","approvedStaffId":412,"billedPerUnit":250,"costPerUnit":95,"customFieldValues":{},"deptId":3,"isApproved":true,"isCreatedByAiwyn":false,"isLocked":false,"isManagedByAiwyn":false,"isPosted":true,"loggedStaffId":412,"officeId":2,"pmsRef":"1789456","postedDate":"2024-01-19T05:00:00","postedStaffId":415,"rawUnits":5,"serviceLineId":4,"staffTypeId":7,"taskTypeId":12,"units":5,"updatedByStaffId":415,"client":{"id":1561,"name":"Cammie Cremin"}}],"acme_vw_wip_unified_aggregate":{"aggregate":{"count":84,"sum":{"wipValue":24186.15,"billedAmount":19612.07,"wipValueOutstanding":0}}}},"key":"real_api_response","summary":"Sample from actual API response","id":"paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/real_api_response"},"paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/empty_response":{"value":{"acme_vw_wip_unified":[],"acme_vw_wip_unified_aggregate":{"aggregate":{"count":0,"sum":{"wipValue":0,"billedAmount":0,"wipValueOutstanding":0}}}},"key":"empty_response","summary":"No WIP records found","id":"paths/~1gql~1v1~1wip/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1wip/post/responses/400/content/application~1json/examples/unexpected_variable":{"value":{"path":"$","error":"Unexpected variable clientId","code":"bad-request"},"key":"unexpected_variable","summary":"Filter property sent to the list endpoint","id":"paths/~1gql~1v1~1wip/post/responses/400/content/application~1json/examples/unexpected_variable"},"paths/~1gql~1v1~1wip/post/responses/401/content/application~1json/examples/missing_auth":{"value":{"error":"Authorization header is required","code":"MISSING_AUTH_HEADER"},"key":"missing_auth","summary":"Missing authentication header","id":"paths/~1gql~1v1~1wip/post/responses/401/content/application~1json/examples/missing_auth"},"paths/~1gql~1v1~1wips~1search/post/requestBody/content/application~1json/example":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"wipType":{"_in":["Time","Expense"]}},{"notes":{"_ilike":"%consultation%"}}]},{"isActive":{"_eq":true}},{"loggedDate":{"_gte":"1900-01-01T00:00:00Z"}},{"clientId":{"_in":[1001,1002,1003]}}]},"orderBy":[{"loggedDate":"desc"},{"wipValue":"desc"}]},"id":"paths/~1gql~1v1~1wips~1search/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/success":{"value":{"wips":[{"id":89012,"wipType":"Progress","loggedDate":"2024-01-17T05:00:00","wipValue":1250,"wipValueOutstanding":0,"billedAmount":1225,"writeOffAmount":25,"notes":"Consultation and analysis for Q1 financial review","clientId":1561,"jobId":2514,"isActive":true,"createdAt":"2024-05-12T23:02:33.24516+00:00","updatedAt":"2024-05-12T23:02:33.24516+00:00","approvedDate":"2024-01-18T05:00:00","approvedStaffId":412,"billedPerUnit":250,"costPerUnit":95,"customFieldValues":{},"deptId":3,"isApproved":true,"isCreatedByAiwyn":false,"isLocked":false,"isManagedByAiwyn":false,"isPosted":true,"loggedStaffId":412,"officeId":2,"pmsRef":"1789456","postedDate":"2024-01-19T05:00:00","postedStaffId":415,"rawUnits":5,"serviceLineId":4,"staffTypeId":7,"taskTypeId":12,"units":5,"updatedByStaffId":415,"client":{"id":1561,"name":"TechFlow Enterprises"}}],"total":{"aggregate":{"count":84,"sum":{"wipValue":24186.15,"wipValueOutstanding":125,"billedAmount":19612.07,"writeOffAmount":449.08},"avg":{"wipValue":287.93}}}},"key":"success","summary":"WIP records with aggregates","id":"paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/empty":{"value":{"wips":[],"total":{"aggregate":{"count":0,"sum":{"wipValue":null,"wipValueOutstanding":null,"billedAmount":null,"writeOffAmount":null},"avg":{"wipValue":null}}}},"key":"empty","summary":"No WIP records matched the filter","id":"paths/~1gql~1v1~1wips~1search/post/responses/200/content/application~1json/examples/empty"},"paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/success":{"value":{"wip":[{"id":89012,"wipType":"Progress","loggedDate":"2024-01-17T05:00:00","wipValue":1250,"wipValueOutstanding":0,"billedAmount":1225,"writeOffAmount":25,"notes":"Consultation and analysis for Q1 financial review","clientId":1561,"jobId":2514,"isActive":true,"createdAt":"2024-05-12T23:02:33.24516+00:00","updatedAt":"2024-05-12T23:02:33.24516+00:00","approvedDate":"2024-01-18T05:00:00","approvedStaffId":412,"billedPerUnit":250,"costPerUnit":95,"customFieldValues":{},"deptId":3,"isApproved":true,"isCreatedByAiwyn":false,"isLocked":false,"isManagedByAiwyn":false,"isPosted":true,"loggedStaffId":412,"officeId":2,"pmsRef":"1789456","postedDate":"2024-01-19T05:00:00","postedStaffId":415,"rawUnits":5,"serviceLineId":4,"staffTypeId":7,"taskTypeId":12,"units":5,"updatedByStaffId":415,"client":{"id":1561,"name":"TechFlow Enterprises"}}]},"key":"success","summary":"WIP record found","id":"paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/success"},"paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"wip":[]},"key":"not_found","summary":"WIP record not found","id":"paths/~1gql~1v1~1time~1wip~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1time~1wip~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id":{"value":{"code":"data-exception","error":"invalid input syntax for type integer: \"abc\""},"key":"non_numeric_id","summary":"Non-numeric id","id":"paths/~1gql~1v1~1time~1wip~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"},"paths/~1api~1v1~1codes/post/requestBody/content/application~1json/example":{"value":{"records":[{"type":"ExpenseCode","systemRef":{"system":"PM","reference":"TRAVEL"},"attributes":{"pmsRef":"TRAVEL","code":"TRAVEL","display":"Travel","description":"Mileage, airfare and lodging","billable":true,"reimbursable":true,"taxable":false,"active":true}}]},"id":"paths/~1api~1v1~1codes/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1entries/post/requestBody/content/application~1json/example":{"value":{"records":[{"type":"TimeEntry","systemRef":{"system":"PM","reference":"laurel-entry-001"},"attributes":{"pmsRef":"laurel-entry-001","type":"Time","loggedDate":"2026-06-17T09:00:00Z","units":2.5,"value":0,"costPerUnit":0,"billedAmount":0,"writeOffAmount":0,"notes":"Worked on tax planning deliverable","clientId":{"system":"PM","reference":"37584"},"jobId":{"system":"PM","reference":"AIWYN_29059"},"loggedStaffId":{"system":"PM","reference":"12345"},"code":"TXBLE30X01"}}]},"id":"paths/~1api~1v1~1entries/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1time-codes/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"ADMIN"},"attributes":{"pmsRef":"ADMIN","code":"ADMIN","display":"Administration","billable":false,"active":true}}]},"id":"paths/~1api~1v1~1time-codes/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1time-entries/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"entry-001"},"attributes":{"loggedDate":"2026-06-17T09:00:00Z","loggedStaffId":{"system":"PM","reference":"12345"},"clientId":{"system":"PM","reference":"37584"},"jobId":{"system":"PM","reference":"AIWYN_29059"},"code":"TXBLE30X01","units":2.5,"value":0,"costPerUnit":0,"billedAmount":0,"writeOffAmount":0,"notes":"Tax planning deliverable"}}]},"id":"paths/~1api~1v1~1time-entries/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1expense-codes/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"TRAVEL"},"attributes":{"pmsRef":"TRAVEL","code":"TRAVEL","display":"Travel","description":"Mileage, airfare and lodging","billable":true,"reimbursable":true,"taxable":false,"active":true}}]},"id":"paths/~1api~1v1~1expense-codes/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1expense-entries/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"expense-001"},"attributes":{"loggedDate":"2026-06-17T00:00:00Z","loggedStaffId":{"system":"PM","reference":"12345"},"clientId":{"system":"PM","reference":"37584"},"jobId":{"system":"PM","reference":"AIWYN_29059"},"code":"TRAVEL","value":123.45,"units":1,"costPerUnit":123.45,"billedPerUnit":123.45,"billedAmount":0,"writeOffAmount":0,"billable":true,"notes":"Client site travel"}}]},"id":"paths/~1api~1v1~1expense-entries/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1operational-codes/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"TRAINING"},"attributes":{"pmsRef":"TRAINING","code":"TRAINING","display":"Internal training","active":true}}]},"id":"paths/~1api~1v1~1operational-codes/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1operational-entries/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"op-entry-001"},"attributes":{"loggedAt":"2026-06-17T09:00:00Z","loggedStaffId":{"system":"PM","reference":"12345"},"code":"TRAINING","units":1.5,"comment":"Internal training"}}]},"id":"paths/~1api~1v1~1operational-entries/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1pto-codes/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"VACATION"},"attributes":{"pmsRef":"VACATION","code":"VACATION","internalNotes":"Annual leave","active":true}}]},"id":"paths/~1api~1v1~1pto-codes/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1pto-entries/post/requestBody/content/application~1json/example":{"value":{"records":[{"systemRef":{"system":"PM","reference":"pto-entry-001"},"attributes":{"loggedAt":"2026-07-08T00:00:00Z","loggedStaffId":{"system":"PM","reference":"12345"},"code":"VACATION","units":8,"comments":"Vacation"}}]},"id":"paths/~1api~1v1~1pto-entries/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1staff/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1staff/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/successful_response":{"value":{"staff":[{"id":202,"pmsRef":"2254","staffRef":"HAB","firstName":"Holley","lastName":"Abbott","email":"ena.toy@hotmail.com","active":true,"deptId":8,"jobTitle":null,"jobTitleId":null,"type":null,"officeId":2,"department":{"id":8,"pmsRef":"TAX","name":"Tax"},"office":{"id":2,"pmsRef":"NYC","name":"New York","city":"New York","stateProvince":"NY","country":"US"},"serviceLine":{"id":4,"pmsRef":"TAX","name":"Tax"},"subServiceLine":{"id":12,"pmsRef":"TAX-COMP","name":"Tax Compliance"},"wageType":{"id":1,"pmsRef":"SAL","name":"Salary"},"employeeType":{"id":2,"pmsRef":"FT","name":"Full Time"},"role":{"id":11,"pmsRef":"MANAGER","display":"Manager","description":"Manager"},"permissionSet":{"id":3,"name":"Standard Manager"},"staffSupervisor":{"id":53,"pmsRef":"A53","staffRef":"AH","firstName":"Allen","lastName":"Hermiston","email":"allen.hermiston@company.com"},"rateCardBillingRates":[],"staffManagerId":53,"updatedAt":"2026-09-21T18:30:00Z","createdAt":"2024-05-12T22:42:02.719873+00:00","fullName":"Holley Abbott","prefix":null,"startDt":"2024-01-08T00:00:00","endDt":null,"staffPartnerId":53,"staffPaId":null,"orgId":1,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"lastUpdatedByStaffId":53,"customFieldValues":{}}],"total":{"aggregate":{"count":138}}},"key":"successful_response","summary":"Staff directory with department and type information","id":"paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/successful_response"},"paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/empty_response":{"value":{"staff":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"No staff found","id":"paths/~1gql~1v1~1staff/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/invalid_page_size":{"value":{"error":"pageSize must be an integer from 1 to 1000"},"key":"invalid_page_size","summary":"Invalid pageSize parameter","id":"paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/invalid_page_size"},"paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/negative_page":{"value":{"error":"page must be an integer of 0 or more"},"key":"negative_page","summary":"Negative page","id":"paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/negative_page"},"paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/unexpected_variable":{"value":{"code":"bad-request","error":"Unexpected variable isActive","path":"$"},"key":"unexpected_variable","summary":"Unsupported filter property","id":"paths/~1gql~1v1~1staff/post/responses/400/content/application~1json/examples/unexpected_variable"},"paths/~1gql~1v1~1staff/post/responses/401/content/application~1json/examples/insufficient_permissions":{"value":{"error":"Access denied. Missing Roles","code":"INSUFFICIENT_PERMISSIONS"},"key":"insufficient_permissions","summary":"User lacks required role","id":"paths/~1gql~1v1~1staff/post/responses/401/content/application~1json/examples/insufficient_permissions"},"paths/~1gql~1v1~1staff~1search/post/requestBody/content/application~1json/example":{"value":{"pageSize":1,"where":{"_and":[{"_or":[{"firstName":{"_ilike":"%john%"}},{"lastName":{"_ilike":"%doe%"}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"deptId":{"_in":[1,2,3]}}]},"orderBy":[{"lastName":"asc"},{"firstName":"asc"}]},"id":"paths/~1gql~1v1~1staff~1search/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/filtered_response":{"value":{"staff":[{"id":202,"pmsRef":"2254","staffRef":"HAB","firstName":"Holley","lastName":"Abbott","email":"ena.toy@hotmail.com","active":true,"deptId":8,"jobTitle":null,"jobTitleId":null,"type":null,"officeId":2,"department":{"id":8,"pmsRef":"TAX","name":"Tax"},"office":{"id":2,"pmsRef":"NYC","name":"New York","city":"New York","stateProvince":"NY","country":"US"},"serviceLine":{"id":4,"pmsRef":"TAX","name":"Tax"},"subServiceLine":{"id":12,"pmsRef":"TAX-COMP","name":"Tax Compliance"},"wageType":{"id":1,"pmsRef":"SAL","name":"Salary"},"employeeType":{"id":2,"pmsRef":"FT","name":"Full Time"},"role":{"id":11,"pmsRef":"MANAGER","display":"Manager","description":"Manager"},"permissionSet":{"id":3,"name":"Standard Manager"},"staffSupervisor":{"id":53,"pmsRef":"A53","staffRef":"AH","firstName":"Allen","lastName":"Hermiston","email":"allen.hermiston@company.com"},"rateCardBillingRates":[],"staffManagerId":53,"updatedAt":"2026-09-21T18:30:00Z","createdAt":"2024-05-12T22:42:02.719873+00:00","fullName":"Holley Abbott","prefix":null,"startDt":"2024-01-08T00:00:00","endDt":null,"staffPartnerId":53,"staffPaId":null,"orgId":1,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"lastUpdatedByStaffId":53,"customFieldValues":{}}],"total":{"aggregate":{"count":1}}},"key":"filtered_response","summary":"Filtered staff with dynamic ordering","id":"paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/filtered_response"},"paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/empty_response":{"value":{"staff":[],"total":{"aggregate":{"count":0}}},"key":"empty_response","summary":"No staff found matching criteria","id":"paths/~1gql~1v1~1staff~1search/post/responses/200/content/application~1json/examples/empty_response"},"paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/found":{"value":{"staff":{"id":202,"pmsRef":"2254","staffRef":"HAB","firstName":"Holley","lastName":"Abbott","email":"ena.toy@hotmail.com","active":true,"deptId":8,"jobTitle":null,"jobTitleId":null,"type":null,"officeId":2,"department":{"id":8,"pmsRef":"TAX","name":"Tax"},"office":{"id":2,"pmsRef":"NYC","name":"New York","city":"New York","stateProvince":"NY","country":"US"},"serviceLine":{"id":4,"pmsRef":"TAX","name":"Tax"},"subServiceLine":{"id":12,"pmsRef":"TAX-COMP","name":"Tax Compliance"},"wageType":{"id":1,"pmsRef":"SAL","name":"Salary"},"employeeType":{"id":2,"pmsRef":"FT","name":"Full Time"},"role":{"id":11,"pmsRef":"MANAGER","display":"Manager","description":"Manager"},"rateCardBillingRates":[],"permissionSet":{"id":3,"name":"Standard Manager"},"staffSupervisor":null,"staffManagerId":53,"updatedAt":"2026-09-21T18:30:00Z","createdAt":"2024-05-12T22:42:02.719873+00:00","fullName":"Holley Abbott","prefix":null,"startDt":"2024-01-08T00:00:00","endDt":null,"staffPartnerId":53,"staffPaId":null,"orgId":1,"isCreatedByAiwyn":false,"isManagedByAiwyn":false,"lastUpdatedByStaffId":53,"customFieldValues":{}}},"key":"found","summary":"Staff member found","id":"paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/found"},"paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/not_found":{"value":{"staff":null},"key":"not_found","summary":"No staff member with this id","id":"paths/~1gql~1v1~1staff~1{id}/get/responses/200/content/application~1json/examples/not_found"},"paths/~1gql~1v1~1staff~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id":{"value":{"code":"data-exception","error":"invalid input syntax for type integer: \"abc\"","path":"$"},"key":"non_numeric_id","summary":"Non-numeric id","id":"paths/~1gql~1v1~1staff~1{id}/get/responses/400/content/application~1json/examples/non_numeric_id"},"paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/minimal":{"value":{"firstName":"Jane","lastName":"Doe","pmsRef":"EMP-1042","ref":"doe-j"},"key":"minimal","summary":"Minimal required fields only","id":"paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/minimal"},"paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/with_rate_card":{"value":{"firstName":"Jane","lastName":"Doe","pmsRef":"EMP-1042","ref":"doe-j","email":"jane.doe@firm.com","jobTitle":"Senior Associate","active":true,"rateCardAssignment":{"rateCardId":5,"billingRates":[{"rateTypeId":12,"hourlyBillingRate":150},{"rateTypeId":13,"hourlyBillingRate":175}],"averageCost":75}},"key":"with_rate_card","summary":"Staff with full rate card assignment","id":"paths/~1api~1v1~1staff/post/requestBody/content/application~1json/examples/with_rate_card"},"paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_only":{"value":{"data":{"id":312,"pmsRef":"EMP-1042","ref":"doe-j","firstName":"Jane","lastName":"Doe","fullName":"Jane Doe","email":"jane.doe@firm.com","active":true,"version":0,"createdAt":"2024-03-15T10:00:00Z","updatedAt":"2024-03-15T10:00:00Z","rateCardAssignment":null},"meta":{"success":true,"message":"Staff member created successfully","timestamp":"2024-03-15T10:00:00Z","version":"v1"}},"key":"staff_only","summary":"Staff created without rate card assignment","id":"paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_only"},"paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_with_rate_card":{"value":{"data":{"id":312,"pmsRef":"EMP-1042","ref":"doe-j","firstName":"Jane","lastName":"Doe","fullName":"Jane Doe","email":"jane.doe@firm.com","active":true,"version":0,"createdAt":"2024-03-15T10:00:00Z","updatedAt":"2024-03-15T10:00:00Z","rateCardAssignment":{"rateCardId":5,"billingRateIds":[101,102],"averageCostId":201}},"meta":{"success":true,"message":"Staff member created successfully","timestamp":"2024-03-15T10:00:00Z","version":"v1"}},"key":"staff_with_rate_card","summary":"Staff created with billing rates and average cost","id":"paths/~1api~1v1~1staff/post/responses/201/content/application~1json/examples/staff_with_rate_card"},"paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_only":{"value":{"jobTitle":"Manager","departmentId":4,"active":true},"key":"fields_only","summary":"Update staff fields only (no rate card change)","id":"paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_only"},"paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/replace_rate_card":{"value":{"rateCardAssignment":{"rateCardId":6,"billingRates":[{"rateTypeId":12,"hourlyBillingRate":200}],"averageCost":95}},"key":"replace_rate_card","summary":"Replace rate card assignment","id":"paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/replace_rate_card"},"paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_and_rate_card":{"value":{"jobTitle":"Senior Manager","rateCardAssignment":{"rateCardId":6,"billingRates":[{"rateTypeId":12,"hourlyBillingRate":200},{"rateTypeId":13,"hourlyBillingRate":225}],"averageCost":95}},"key":"fields_and_rate_card","summary":"Update fields and replace rate card in one request","id":"paths/~1api~1v1~1staff~1{staffId}/put/requestBody/content/application~1json/examples/fields_and_rate_card"},"paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/fields_updated":{"value":{"data":{"id":312,"pmsRef":"EMP-1042","ref":"doe-j","firstName":"Jane","lastName":"Doe","fullName":"Jane Doe","jobTitle":"Manager","active":true,"version":0,"updatedAt":"2024-06-01T09:00:00Z","rateCardAssignment":null},"meta":{"success":true,"message":"Staff member updated successfully","timestamp":"2024-06-01T09:00:00Z","version":"v1"}},"key":"fields_updated","summary":"Fields updated, no rate card change","id":"paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/fields_updated"},"paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/rate_card_replaced":{"value":{"data":{"id":312,"pmsRef":"EMP-1042","ref":"doe-j","firstName":"Jane","lastName":"Doe","fullName":"Jane Doe","jobTitle":"Manager","active":true,"version":0,"updatedAt":"2024-06-01T09:00:00Z","rateCardAssignment":{"rateCardId":6,"billingRateIds":[205],"averageCostId":301}},"meta":{"success":true,"message":"Staff member updated successfully","timestamp":"2024-06-01T09:00:00Z","version":"v1"}},"key":"rate_card_replaced","summary":"Rate card assignment replaced","id":"paths/~1api~1v1~1staff~1{staffId}/put/responses/200/content/application~1json/examples/rate_card_replaced"},"paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody/content/application~1json/example":{"value":{"items":[{"display":"Associate","description":"Associate staff type"},{"display":"Manager","description":"Manager staff type"}]},"id":"paths/~1api~1v1~1staff~1type~1batch~1create/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody/content/application~1json/example":{"value":{"pageSize":25,"page":0},"id":"paths/~1api~1v1~1staff~1type~1batch~1lookup/post/requestBody/content/application~1json/example"},"paths/~1gql~1v1~1departments/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1departments/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1departments/post/responses/200/content/application~1json/examples/sample":{"value":{"departments":[{"id":7,"pmsRef":"DEPT-7","name":"Tax","active":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":true,"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-02T03:04:05Z","version":1,"createdByStaffId":null,"lastUpdatedByStaffId":53,"customFieldValues":{}}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1departments/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1offices/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1offices/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1offices/post/responses/200/content/application~1json/examples/sample":{"value":{"offices":[{"id":2,"pmsRef":"OFF-2","name":"Austin - Downtown","active":true,"city":"Austin","stateProvince":"TX","country":"US","zip":"78701","isCreatedByAiwyn":true,"isManagedByAiwyn":true,"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-02T03:04:05Z","version":1,"address":"100 Congress Ave, Suite 200, Austin, TX 78701","addressLine1":"100 Congress Ave","addressLine2":"Suite 200","phone":"+1 512 555 0100","fax":null,"email":"austin@example.com","timezone":"America/Chicago","createdByStaffId":null,"lastUpdatedByStaffId":53,"customFieldValues":{}}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1offices/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1orgs/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1orgs/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1orgs/post/responses/200/content/application~1json/examples/sample":{"value":{"orgs":[{"id":1,"pmsRef":"ORG-1","name":"Acme Accounting","active":true,"defaultBillingDay":15,"isDefault":true,"isCreatedByAiwyn":true,"isManagedByAiwyn":true,"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-02T03:04:05Z","version":1,"createdByStaffId":null,"lastUpdatedByStaffId":53,"customFieldValues":{}}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1orgs/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1industries/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1industries/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1industries/post/responses/200/content/application~1json/examples/sample":{"value":{"industries":[{"id":55,"name":"Healthcare","active":true,"industryType":"NAICS","ref":"HC","sysRefs":{},"createdAt":"2025-01-02T03:04:05Z","updatedAt":"2025-01-02T03:04:05Z","version":1,"pmsRefs":"HC","customFieldValues":{}}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1industries/post/responses/200/content/application~1json/examples/sample"},"paths/~1gql~1v1~1service_lines/post/requestBody/content/application~1json/examples/default_pagination":{"value":{"pageSize":50,"page":0},"key":"default_pagination","summary":"Default pagination","id":"paths/~1gql~1v1~1service_lines/post/requestBody/content/application~1json/examples/default_pagination"},"paths/~1gql~1v1~1service_lines/post/responses/200/content/application~1json/examples/sample":{"value":{"serviceLines":[{"id":10,"pms_ref":"SL-10","name":"Tax","active":true,"charge_admin_fee":false,"created_at":"2025-01-02T03:04:05Z","updated_at":"2025-01-02T03:04:05Z","version":1,"is_created_by_aiwyn":false,"is_managed_by_aiwyn":false,"created_by_staff_id":null,"last_updated_by_staff_id":53,"business_entity_id":null,"custom_field_values":{}}],"total":{"aggregate":{"count":1}}},"key":"sample","summary":"Sample response","id":"paths/~1gql~1v1~1service_lines/post/responses/200/content/application~1json/examples/sample"},"paths/~1api~1v1~1records/post/requestBody/content/application~1json/example":{"value":{"records":[{"type":"Client","systemRef":{"system":"CCH","reference":"C-12345"},"attributes":{"name":"Acme Corporation","email":"contact@acme.com"}}]},"id":"paths/~1api~1v1~1records/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1records/put/requestBody/content/application~1json/example":{"value":{"records":[{"type":"Client","systemRef":{"system":"CCH","reference":"C-12345"},"attributes":{"email":"updated@acme.com","phone":"555-1234"}}]},"id":"paths/~1api~1v1~1records/put/requestBody/content/application~1json/example"},"paths/~1api~1v1~1records/delete/requestBody/content/application~1json/example":{"value":{"records":[{"type":"Client","systemRef":{"system":"CCH","reference":"C-12345"}},{"type":"Client","systemRef":{"system":"aiwyn","reference":"67890"}}]},"id":"paths/~1api~1v1~1records/delete/requestBody/content/application~1json/example"},"paths/~1api~1v1~1event-subscriptions/post/requestBody/content/application~1json/example":{"value":{"entityType":"RequestItem","operation":"SENT","deliveryUrl":"https://example.com/webhooks/aiwyn"},"id":"paths/~1api~1v1~1event-subscriptions/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1webhook~1test~1generate/post/requestBody/content/application~1json/example":{"value":{"payload":{"test":true},"secret":"my-test-secret"},"id":"paths/~1api~1v1~1webhook~1test~1generate/post/requestBody/content/application~1json/example"},"paths/~1api~1v1~1webhook~1test~1validate/post/requestBody/content/application~1json/example":{"value":{"payload":{"test":true},"signature":"sha256=...","secret":"my-test-secret"},"id":"paths/~1api~1v1~1webhook~1test~1validate/post/requestBody/content/application~1json/example"},"paths/event/post/requestBody/content/application~1json/examples/payment":{"value":{"event":{"id":7001,"type":"POSTED","entityType":"Payment","entityId":"48213","eventTimestamp":"2026-11-01T18:04:03.517Z","data":{"tenant":"acmecpa","primaryRecord":{"paymentMethod":"card","cardType":"visa","last4":"4242","postedToBank":false,"isAutomatic":false},"relatedEntitiesData":null,"metadata":{"paymentLinkMetadata":{"orderRef":"INV-2026-0042"}}}},"subscription":{"id":9,"description":"Post payments to our ERP"}},"key":"payment","summary":"A payment is posted (primaryRecord abridged)","id":"paths/event/post/requestBody/content/application~1json/examples/payment"},"paths/event/post/requestBody/content/application~1json/examples/consent":{"value":{"event":{"id":7003,"type":"CONSENT_RECORDED","entityType":"Engagement","entityId":"3120","eventTimestamp":"2026-11-01T18:20:00.000Z","data":{"tenant":"acmecpa","primaryRecord":{"id":3120,"name":"2026 Individual Tax Return","clientId":1001,"status":"SENT"},"relatedEntitiesData":{"Client":[{"id":1001,"name":"Sarah Johnson"}],"ClientGroup":[],"Job":[{"id":5521,"name":"2026 1040"}]},"metadata":{"engagementDocumentId":8840,"engagementDocumentTypeId":4,"signatureRequirementType":"ALL_SIGNATURES_REQUIRED","consentStatus":"NEGATIVE","decidedAt":"2026-11-01T18:19:58.402","signers":[{"engagementDocumentContactId":9911,"contactId":2044,"consentStatus":"NEGATIVE","consentProvidedAt":"2026-11-01T18:19:58.402"}]}}},"subscription":{"id":14,"description":"Write 7216 status to our workflow tool"}},"key":"consent","summary":"A client declines a consent (primaryRecord and relatedEntitiesData abridged)","id":"paths/event/post/requestBody/content/application~1json/examples/consent"},"paths/event/post/requestBody/content/application~1json/examples/file":{"value":{"event":{"id":7002,"type":"CREATED","entityType":"File","entityId":"1024","eventTimestamp":"2026-11-01T18:10:00.000Z","data":{"tenant":"acmecpa","primaryRecord":{"eventType":"file.created","timestamp":"2026-11-01T18:10:00.000Z","file":{"id":1024,"name":"2025-tax-return.pdf","sizeBytes":482113,"path":"Clients/Sarah Johnson/2025","clientId":1001,"clientName":"Sarah Johnson","downloadUrl":"https://storage.googleapis.com/example-bucket/2025-tax-return.pdf?X-Goog-Signature=...","downloadUrlExpiresAt":"2026-11-01T19:10:00Z"}},"relatedEntitiesData":null}},"subscription":{"id":12,"description":"Archive client uploads"}},"key":"file","summary":"A file is uploaded","id":"paths/event/post/requestBody/content/application~1json/examples/file"},"paths/event/post/requestBody/content/application~1json/examples/requestItem":{"value":{"event":{"id":7004,"type":"SENT","entityType":"RequestItem","entityId":"6612","eventTimestamp":"2026-11-01T18:30:00.000Z","data":{"tenant":"acmecpa","primaryRecord":{"id":6612,"clientRequestSectionId":802,"name":"2025 W-2 forms","status":"OPEN","dueDate":"2026-12-01"},"relatedEntitiesData":null,"metadata":{"status_old":"TO_DO","recipients":[{"id":2044,"name":"Sarah Johnson","email":"sarah.johnson@example.com"}]}}},"subscription":{"id":15,"description":"Track document requests"}},"key":"requestItem","summary":"A request item is sent to the client (primaryRecord abridged)","id":"paths/event/post/requestBody/content/application~1json/examples/requestItem"}},"securitySchemeStore":{"ApiKeyAuth":{"id":"ApiKeyAuth","type":"apiKey","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Direct JWT API key authentication (recommended)."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send your long-lived JWT API key in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Api-Key"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"X-Aiwyn-Api-Key: dev:eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"X-Aiwyn-Api-Key: dev:eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The server validates the key, loads your identity and permissions directly from the database,"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"and sets the tenant context from the key itself. The key alone decides who you are and which tenant"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"you reach. Do not send a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header with the key:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"/gql/v1/..."},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" paths ignore it, like any other header such as "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"/api/v1/..."},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" paths refuse the request with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"403"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header is present, whatever its"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"value, even your own tenant. The error body does not name the header: on an endpoint that"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"requires a role, its message says which roles the endpoint requires ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"INSUFFICIENT_ROLE"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") even when your key has one of them. Elsewhere it reads "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Access Denied"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"details.reason"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" is "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"ACCESS_DENIED"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"). Remove the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header before looking for a"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"permissions problem."},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Note:"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"refresh-token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" and "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"revoke-token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" require an "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization: Bearer"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" token and"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"do not support "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Aiwyn-Api-Key"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl -X POST https://api.sandbox.aiwyn.app/gql/v1/clients \\\n     -H \"CF-Access-Client-Id: <cf-access-client-id>\" \\\n     -H \"CF-Access-Client-Secret: <cf-access-client-secret>\" \\\n     -H \"X-Aiwyn-Api-Key: dev:eyJhbGciOiJIUzUxMiJ9...\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl -X POST https://api.sandbox.aiwyn.app/gql/v1/clients \\\n     -H \"CF-Access-Client-Id: <cf-access-client-id>\" \\\n     -H \"CF-Access-Client-Secret: <cf-access-client-secret>\" \\\n     -H \"X-Aiwyn-Api-Key: dev:eyJhbGciOiJIUzUxMiJ9...\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}],"in":"header","paramName":"X-Aiwyn-Api-Key"},"BearerAuth":{"id":"BearerAuth","type":"http","scheme":"bearer","bearerFormat":"JWT","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Short-lived bearer token authentication."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Send the bearer token in the "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" header:"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"Authorization: Bearer eyJ...\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"The tenant is read from the token's "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" claim. The token alone decides who you are and which"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"tenant you reach: any other header, including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Tenant"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" or "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"X-Tenant-ID"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":", is ignored."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Token requirements:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Issued by Aiwyn, obtained via "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Carries your role-based permissions and tenant context"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Standard expiration: 1 hour (3600 seconds)"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Request a new token from "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"/v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" when the current one expires;"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"a "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"401"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" response indicates a missing or expired token."},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Example:"},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","language":"bash"},"children":[{"$$mdtype":"Node","attributes":{"content":"curl --request POST 'https://api.sandbox.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n"},"children":[],"type":"text"}],"type":"fence"}]},"CfAccessClientId":{"id":"CfAccessClientId","type":"apiKey","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client ID issued by Aiwyn. Required on every request to Sandbox"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.sandbox.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":") and Staging ("},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"api.staging.aiwyn.app"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"), including "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"POST /v1/auth/token"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":";"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"send it with "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Secret"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":". Cloudflare checks it at the edge, before the API"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"authenticates the request with your Aiwyn credentials. Production does not use it."},"children":[],"type":"text"}],"type":"paragraph"}],"in":"header","paramName":"CF-Access-Client-Id"},"CfAccessClientSecret":{"id":"CfAccessClientSecret","type":"apiKey","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Cloudflare Access service token client secret issued by Aiwyn. Required alongside"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"CF-Access-Client-Id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" on Sandbox and Staging. Keep it server-side and out of source control."},"children":[],"type":"text"}],"type":"paragraph"}],"in":"header","paramName":"CF-Access-Client-Secret"}},"specVersion":"3.1.0","servers":[{"url":"https://api.sandbox.aiwyn.app","description":"Sandbox (requires Cloudflare Access headers)"},{"url":"https://api.staging.aiwyn.app","description":"Staging (requires Cloudflare Access headers)"},{"url":"https://api.aiwyn.ai","description":"Production (your live firm data; no Cloudflare Access headers)"}],"specType":"openapi"},"options":{"feedback":{"type":"sentiment","settings":{"label":"Was this page helpful?"}},"mockServer":{"off":true},"disableRouter":true,"downloadUrls":[{"url":"/_bundle/@v1/bundle.json?download"},{"url":"/_bundle/@v1/bundle.yaml?download"}],"excludeFromSearch":false,"replayFeatures":{"graphql":false,"asyncapi":false},"specType":"openapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"Aiwyn API","description":"The Aiwyn API gives your integration programmatic access to the clients, contacts, engagements,\nprojects, billing, payments, time, and files in your Aiwyn firm, and pushes changes to you as signed\nwebhooks.\n\n**New here?** The [Quickstart](/reference/quickstart) takes you from credentials to your first\nrequest in a few minutes.\n\n| Topic | Where |\n|-------|-------|\n| Environments, base URLs, path prefixes, and Cloudflare Access | [Base URLs & environments](/reference/base-urls) |\n| API keys and bearer tokens | [Authentication](/reference/authentication) |\n| Roles each endpoint requires | [Authorization](/reference/authorization) |\n| Paging, errors, rate limits, and versions | [Pagination](/reference/pagination), [Errors](/reference/errors), [Rate limits](/reference/rate-limits), [Versioning](/reference/versioning) |\n| Event payloads delivered to your endpoint | **Webhooks** in this reference |\n\nQuestions or credentials: [api-support@aiwyn.ai](mailto:api-support@aiwyn.ai).\n"}},"baseSlug":"/bundle","routesMapping":{}}